Setup

Get a copy of the source code

$ git clone https://github.com/chaosinventory/chaosinventory.git
$ cd chaosinventory

Local environment

To avoid mixing of dependencies, a virtual environment is highly recommended.

$ python3 -m venv venv
$ source venv/bin/activate

Working on and with the code

The code itself is located within the src directory. See Directory Structure for a full documentation on the projects structure.

You will also need to install some requirements using pip.

(venv) $ cd src/
(venv) $ pip install -r requirements.txt

Before you can go on and start coding, you will need a valid configuration file. The easiest way would be, to just link the example config like this:

(venv) $ ln -s chaosinventory.cfg.example chaosinventory.cfg

If you want to use your own configuration (e.G. another Database, E-Mail backend) you can start by copying the example config and edit it to suit your needs.

(venv) $ cp chaosinventory.cfg.example chaosinventory.cfg
(venv) $ $EDITOR chaosinventory.cfg

To populate your local development database you must execute the migrations.

(venv) $ ./manage.py migrate

Create an admin user.

(venv) $ ./manage.py createsuperuser

Fill with some demo data.

(venv) $ ./manage.py load_demo_data

Development server

To run the project and visit it in your browser, django ships a small test server.

(venv) $ ./manage runserver -6

Note

Do not forget the -6 in order to only use proper internet protocols and not bother with legacy stuff.

You can now visit http://[::1]:8000/ in your browser.