Skip to content

samanthasgroup/django-webapps

Repository files navigation

GitHub Actions pre-commit.ci status

django-webapps

Backend for the database, implemented in Django

API Documentation

Can be found at /docs/swagger or /docs/redoc after deployment (or when running locally).

For developers

  1. Clone this repository
  2. Install uv
  3. Run uv sync in the project directory to install dependencies
  4. 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.
  5. Install pre-commit hooks: uv run pre-commit install. They will run on files being committed. black and isort will fix the issues automatically. To check all code, run uv run pre-commit run -a.
  6. Start the required services (PostgreSQL and Redis) using Docker Compose: docker-compose up -d
  7. Create database migrations: uv run manage.py makemigrations api
  8. Apply database migrations: uv run manage.py migrate
  9. Collect static content: uv run manage.py collectstatic
  10. Create a superuser for admin interface: uv run manage.py createsuperuser
  11. Run the server locally: uv run manage.py runserver
  12. Whenever you register a model with django-reversion, run uv run manage.py createinitialrevisions.
  13. Run tests: uv run pytest (or make 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 JSONFields, 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.

Side notes

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

Licenses of 3rd-party packages

DoubleScroll is dual-licensed under the MIT and GPL licenses:

About

Backend for the database, implemented in Django

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages