Development Environment

As a Python project, there are certain steps we recommend for setting up your developer environment.

Running the Project

To run the application locally, run the database migrations and then start the application.

pipenv run darksite/manage.py migrate
pipenv run darksite/manage.py runserver

This will launch the application locally on http://localhost:8000.

Note

You must run the migrate command whenever additional migrations are added to the source. The runserver command will log a warning if you forget to do this, and any new logic relying on the presence of the new tables will cause crashes.

First Time Setup

The first time you run the project, you will want to create a super-user that you can use to access the admin interface.

pipenv run darksite/manage.py createsuperuser

Testing

The project has a comprehensive test suite to ensure correctness. Tests are run using pytest. For more information on our testing process, see the Testing page.

# Unit Tests
pipenv run pytest darksite/

# Functional Tests
pipenv run pytest darksite/functional_tests/