Django implementation of NetJSON NetworkGraph
Project description
Reusable django app for collecting and visualizing network topology.
Current features:
- topology information collector supporting different formats:
NetJSON NetworkGraph
OLSR (jsoninfo/txtinfo)
batman-adv (jsondoc/txtinfo)
BMX6 (q6m)
CNML 1.0
visualizer based on netjsongraph.js
simple HTTP API that exposes data in NetJSON NetworkGraph format
Install stable version from pypi
Install from pypi:
pip install django-netjsongraph
Install development version
Install tarball:
pip install https://github.com/interop-dev/django-netjsongraph/tarball/master
Alternatively you can install via pip using git:
pip install -e git+git://github.com/interop-dev/django-netjsongraph#egg=django-netjsongraph
If you want to contribute, install your cloned fork:
git clone git@github.com:<your_fork>/django-netjsongraph.git
cd django-netjsongraph
python setup.py develop
Setup (integrate in an existing django project)
Add rest_framework and django_netjsongraph to INSTALLED_APPS:
INSTALLED_APPS = [
# other apps
'rest_framework',
'django_netjsongraph'
# ...
]
Include urls in your urlconf (you can change the prefixes according to your needs):
# your other imports ...
from django_netjsongraph.api import urls as netjsongraph_api
from django_netjsongraph.visualizer import urls as netjsongraph_visualizer
urlpatterns = [
# your URLs ...
url(r'^api/', include(netjsongraph_api)),
url(r'', include(netjsongraph_visualizer)),
]
Management Commands
update_topology
After topology URLs (URLs exposing the files that the topology of the network) have been added in the admin, the update_topology management command can be used to collect data and start playing with the network graph:
./manage.py update_topology
Logging
The update_topology management command will automatically try to log errors.
For a good default LOGGING configuration refer to the test settings.
Settings
Setting |
Default value |
Description |
---|---|---|
NETJSONGRAPH_PARSERS |
[] |
List with additional custom netdiff parsers |
NETJSONGRAPH_SIGNALS |
None |
String representing python module to import on initialization. Useful for loading django signals or to define custom behaviour. |
Installing for development
Install sqlite:
sudo apt-get install sqlite3 libsqlite3-dev
Install your forked repo:
git clone git://github.com/<your_fork>/django-netjsongraph
cd django-netjsongraph/
python setup.py develop
Install test requirements:
pip install -r requirements-test.txt
Create database:
cd tests/
./manage.py migrate
./manage.py createsuperuser
Launch development server:
./manage.py runserver
You can access the visualizer at http://127.0.0.1:8000/ and the admin interface at http://127.0.0.1:8000/admin/.
Run tests with:
./runtests.py
Contributing
Announce your intentions in the issue tracker
Fork this repo and install it
Write code
Write tests for your code
Ensure all tests pass
Ensure test coverage is not under 90%
Document your changes
Send pull request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-netjsongraph-0.1.tar.gz
.
File metadata
- Download URL: django-netjsongraph-0.1.tar.gz
- Upload date:
- Size: 76.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac1245ffdd4fae1d9a45d9f96558122470b651d518097daad9b383b0bcc5d6f2 |
|
MD5 | 94db8f298fcedbb13c467c8767fc732e |
|
BLAKE2b-256 | ea500d9b7a156658449f628b5ae011f5b0805fa8d2c708ae9d14eeea2f73f9ab |
Provenance
File details
Details for the file django_netjsongraph-0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_netjsongraph-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 84.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea68e086ac6383e288f74aa186ee2a40bd53dd0521b7b2ea8dac0925689a20b5 |
|
MD5 | 435964d9f131aa9833f887a3a4be4f80 |
|
BLAKE2b-256 | 44012b454e856cdd9e6bf582cdcde72ca5e97e4be6631e01a07c2ccbd94188e9 |