Skip to content

A comprehensive and easy-to-use starting point for your new API with Django and DRF.

License

Notifications You must be signed in to change notification settings

wilfredinni/django-starter-template

Repository files navigation

Django starter template

A comprehensive and easy-to-use starting point for your new API with Django and DRF.

Test Status CodeQL Status MIT License

Key features

Requirements

  • 💻 VS Code
  • 🐋 Docker
  • 🐳 Docker Compose

How to use

  1. Clone the repo or use it as a template to start a new project. use
  2. Open the project in VS Code.
  3. If you installed the recommended extensions, open Todo Tree in the sidebar. It will guide you trough the first steps setting up your project, like changing the name of the container, adjusting your URLS, etc. todo
  4. ⚠️ Use env.example to create a .env file.
  5. Hit CTL/CMD + Shift + p and select Reopen in container. This will:
    • Create a dev container.
    • Setup a Redis server.
    • Setup your PostgreSQL database.
    • Install the dependencies.
    • Migrate the database.
  6. Create your super user with python manage.py createsuperuser.
  7. Run the project with python manage.py reserver.
  8. Work as usual.

Commands

This template comes with some shortcuts so you don't have to memorize how to start the workers:

  • poetry run worker: to start a new Celery worker.
  • poetry run beat: to start your periodic tasks.

You can also use:

  • poetry run server instead of python manage.py runserver
  • poetry run makemigrations instead of python manage.py makemigrations
  • poetry run migrate instead of python manage.py migrate

Todo

  • Index Page with a link to the Django admin
  • OpenAPI 3 schema generation and Swagger.
  • CI with Github Actions
  • Add method to restore soft deleted data
  • Email sending with celery
  • Data seeding
  • API Versioning
  • Production Docker file
  • Production Docker compose file
  • CD with Github Actions