The NetDash project's goal is to create an interface to allow delegation of specific IT infrastructure management tasks to IT teams outside of a central IT team.
By default NetDash is configured to use the netdash.settings
module. This module corresponds to the file: "src/netdash/netdash/settings.py" which is ignored in .gitignore, so isn't provided with the source. To configure the settings, copy one of the *_example_*
files in the "src/netdash/netdash/" directory to the settings.py file. Or set the DJANGO_SETTINGS_MODULE
environment variable to use one of the provided examples or a custom settings module.
For example:
cp src/netdash/netdash/settings_example.py src/netdash/netdash/settings.py
will copy the example settings to the default location. You can modify after copying.export DJANGO_SETTINGS_MODULE=netdash.settings_example_compose
will configure NetDash to use settings suitable for the Docker Compose setup.export DJANGO_SETTINGS_MODULE=netdash.settings_env
will configure NetDash to use settings that will pull values from the environment. This is suitable for a Kuberbetes or OpenShift deployment.
Development with Docker Compose (quickstart)
- Clone this repository.
- Change to the new directory:
cd netdash
export DJANGO_SETTINGS_MODULE=netdash.settings_env
(or see the Configuration section above).- Start the services:
docker-compose up
This will spin up a few services:
- NetDash instance (served at 127.0.0.1:8888)
- NetBox instance (served at 127.0.0.1:8000)
- Databases for both
The netdash.settings_example_compose
module configures the NetDash instance is configured by default to use the NetBox instance as its backend.
Development with Pipenv
- Clone this repository.
- Change to the new directory:
cd netdash
- Create an environment with the development dependencies:
pipenv install -d
- Configure sample settings (see the Configuration section above).
- Run the development server:
pipenv run python3 src/netdash/manage.py runserver
- Connect to the development server interface: http://127.0.0.1:8000/
- Clone this repository.
- Change to the new directory:
cd netdash
- Create a virtualenv:
python3 -m venv venv
- Activate the environment:
source ./venv/bin/activate
- Install the package in editable mode:
pip install -e .
- Configure sample settings (see the Configuration section above).
- Change to the project directory:
cd src/netdash
- Run the migrations:
python3 manage.py migrate
- Create an admin user:
python3 manage.py createsuperuser
- Run the development server:
python3 manage.py runserver
- Connect to the development server interface: http://127.0.0.1:8000/
- A module with
urls.py
should declare anapp_name
. - A module with
urls.py
will have its URLs placed under/<app_name>/*
. - A module with a url named
index
in itsurls.py
will have a link toindex
generated in the NetDash navbar. - A module that generates a permission named
can_view_module
will only generate anindex
link in the NetDash navbar for users who have that permission. - A module with
api/urls.py
should declare anapp_name
. If the module also has aurls.py
, it should reuse the previousapp_name
like so:<app_name>-api
- A module with
api/urls.py
will have its API URLs placed under/api/<app_name>/*
.
Check under apps_dev
for examples of the afforementioned conventions.