Skip to content

samanthasgroup/django-webapps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

529 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Actions pre-commit.ci status

django-webapps

Backend for the database, implemented in Django.

Contents

API Documentation

Available after deployment or when running locally:

  • /docs/swagger
  • /docs/redoc

Getting Started

Quick setup to get the app running locally:

  1. Install uv.

  2. Install dependencies:

    uv sync
  3. Create local environment config:

    cp .env.sample .env
  4. Start PostgreSQL and Redis:

    docker compose -f compose.dev.yml up -d

    Or:

    make updev
  5. Apply migrations:

    uv run manage.py migrate
  6. Run the server:

    uv run manage.py runserver

    Or:

    make start

Full Setup

Recommended for active development:

  1. Install dependencies:

    uv sync
  2. Copy the environment file and configure it:

    cp .env.sample .env
  3. Install pre-commit hooks:

    uv run pre-commit install

    Hooks will automatically run on commit.
    black and isort will fix code formatting issues.

    To check all code manually:

    uv run pre-commit run -a
  4. Start required services (PostgreSQL and Redis) using Docker Compose:

    docker compose -f compose.dev.yml up -d

    Or:

    make updev
  5. Create database migrations:

    uv run manage.py makemigrations api
  6. Apply database migrations:

    uv run manage.py migrate
  7. Collect static files:

    uv run manage.py collectstatic
  8. Create a superuser for the admin interface:

    uv run manage.py createsuperuser
  9. Run the server locally:

    uv run manage.py runserver
  10. After registering a model with django-reversion, generate initial revisions:

    uv run manage.py createinitialrevisions
  11. Run tests:

    uv run pytest

    Or:

    make test

Common Commands

Task Command
Lint make lint
Run tests make test
Run server make start
Create migrations (api) uv run manage.py makemigrations api
Start Celery worker make celery
Start Celery beat make celery-beat

Notes

The main page is the Django admin page.
No user-facing web interface is planned yet.

To set up a remote server for development, you can follow this tutorial.

Troubleshooting

pre-commit

If pre-commit hooks behave strangely, try:

pre-commit clean
pre-commit uninstall
pre-commit install
pre-commit run

About

Backend for the database, implemented in Django

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10