Backend for the database, implemented in Django
Can be found at /docs/swagger
or /docs/redoc
after deployment (or when running locally).
- Clone this repository
- Install Poetry
- Run
poetry install
in the project directory to install dependencies. - Activate virtual environment:
poetry shell
. - Install pre-commit hooks:
pre-commit install
. They will run on files being committed.black
andisort
will fix the issues automatically. To check all code, runpre-commit run -a
. - Copy the sample settings file to
settings.py
. For local development, you don't need to make any changes to the contents of the file. - Create database migrations:
python manage.py makemigrations api
- Apply database migrations:
python manage.py migrate
- Collect static content:
python manage.py collectstatic
- Create a superuser for admin interface:
python manage.py createsuperuser
- Run the server locally:
python manage.py runserver
- Whenever you register a model with django-reversion, run
python manage.py createinitialrevisions
. - Run tests:
poetry run pytest
(ormake test
)
Note that in development mode (if you don't change the settings) you will be working with an SQLite database. Since some models contain JSONField
s, it is required that your SQLite installation supports JSON. To check if it does, follow the instructions here.
The main page is the admin page, as no user-facing web interface is planned yet.
That's it for developing locally. To set up a remote server during development, see e.g. this tutorial.
If pre-commit hooks produce strange errors that definitely shouldn't be there, re-installing pre-commit could help:
pre-commit clean
pre-commit uninstall
pre-commit install
pre-commit run
DoubleScroll is dual-licensed under the MIT and GPL licenses: