Library Development

Backend development environment

nox

Install nox.

This tool will help you to setup dev environment and run tests.

Following command will create a virtual environment and install all dependencies:

nox -s dev

Do not forget to activate the virtual environment before run any further commands.

Installing test data

python manage.py migrate
python manage.py loaddata sites/dev/fixtures/data.json

Running backend dev server

python manage.py runserver

An instance of django dev server will be listening on http://localhost:8000/ . Now you can login into django admin interface http://localhost:8000/admin/ with username test and password test.

Frontend development environment

Fronted source files located under the frontend folder.

cd frontend

Installing dependencies

npm install

Running webpack dev server

npm run server:dev:hmr

Now webpack dev server will be listening on http://localhost:3000/ .

Building frontend files

npm run build:prod

Running tests

Running backend tests

python manage.py test

Test it all

You need to know at least one command; the one that runs all the tests:

nox -s unittest