IMPORTANT: This document is meant for a development environment. Although it does contain basic information that will be useful for both testing and production environments, a production environment will most likely need specific configurations to function properly. An experienced professional should be consulted.
In order to run this software, you will need a proper environment. Follow the steps below to get a working environment.
-
Make sure your system fulfills the following list of basic software. Be sure to workaround any eventual naming differences according to the operating system maintainer.
- Python 3.6 (often
python
) - Python virtualenvwrapper (often
python-virtualenvwrapper
) - PostgreSQL 9.6 (often
postgresql
) - PostgreSQL development headers (often
libpq-dev
)
- Python 3.6 (often
-
Create a virtualenv with Python 3.6.x:
$ mkvirtualenv -p $(which python3) my-project
The
mkvirtualenv
command will already activate the newly created environment. In order to activate it in a later time, be sure to run:$ workon my-project
-
Set up a PostgreSQL database to store data. Make sure to have proper administrator access in order to create and configure the new database.
$ createdb my-project
Although you can also use another database system, we recommend that a new environment replicates a production environment as much as possible.
-
Create a file named
.env
and change any necessary environment-specific configuration. Refer to the includedexample.env
to learn more about each option.$ cp example.env .env # Edit .env to match your environment
-
Use the built-in script to configure and install required third-party software and run any necessary database migrations.
$ make dev-setup
Remember to re-run this command every time the source code gets updated. This will make sure that the environment is ready to run the newest version of this project.
Having an environment prepared, according to the steps above, running the software is easy:
$ ./manage.py runserver
This command will start a development server and display the URL to access it using a browser. Note that this is intended for a local development environment only! To run this software in a production environment, an experienced developer should be consulted.
Execute the command below to run all the unit test suites and compile a code coverage report:
$ make test
TODO: Add contribution rules as we evolve.