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 uv
- Run
uv sync
in the project directory to install dependencies - 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. - Install pre-commit hooks:
uv run pre-commit install
. They will run on files being committed.black
andisort
will fix the issues automatically. To check all code, runuv run pre-commit run -a
. - Start the required services (PostgreSQL and Redis) using Docker Compose:
docker-compose up -d
- Create database migrations:
uv run manage.py makemigrations api
- Apply database migrations:
uv run manage.py migrate
- Collect static content:
uv run manage.py collectstatic
- Create a superuser for admin interface:
uv run manage.py createsuperuser
- Run the server locally:
uv run manage.py runserver
- Whenever you register a model with django-reversion, run
uv run manage.py createinitialrevisions
. - Run tests:
uv 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 containJSONField
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: