A Django REST Framework template for building RESTful APIs
Find a file
2024-10-30 22:09:58 +08:00
.woodpecker Set build step to run on x86 2024-10-17 19:36:32 +08:00
backend Clean up docker-compose and run Black formatter over entire codebase 2024-10-30 22:09:58 +08:00
documentation/erd Update webdriver utility functions and add a sample celery task for scraping Google search 2024-09-24 16:08:28 +08:00
.dockerignore Update README.md and fix deployment step in .woodpecker.yml 2024-08-30 19:44:37 +08:00
.env.sample Add native PgBouncer support to alleviate DB connection limit errors 2024-09-05 13:16:23 +08:00
.gitignore Clean up .gitignore and some references to template used for the project 2024-09-06 23:42:03 +08:00
.prettierignore Overhauled entire project config, added notifications, email templates, optimized stripe subscriptions, redis caching, and webdriver utilities 2024-05-10 23:15:29 +08:00
docker-compose.dev.yml Clean up docker-compose and run Black formatter over entire codebase 2024-10-30 22:09:58 +08:00
docker-compose.yml Update deployment 2024-10-17 17:48:32 +08:00
Dockerfile Clean up Dockerfile 2024-10-17 19:12:17 +08:00
Pipfile Clean up docker-compose and run Black formatter over entire codebase 2024-10-30 22:09:58 +08:00
Pipfile.lock Clean up docker-compose and run Black formatter over entire codebase 2024-10-30 22:09:58 +08:00
README.md Update deployment 2024-10-17 17:48:32 +08:00
requirements.txt Switch to Gunicorn 2024-09-15 00:49:30 +08:00
seed_data.json Overhauled entire project config, added notifications, email templates, optimized stripe subscriptions, redis caching, and webdriver utilities 2024-05-10 23:15:29 +08:00
start.sh Revert to Granian and remove bind mount for static files as that seems to just result in crashes 2024-09-15 01:05:54 +08:00

DRF-Template

Build Status Demo Page Status

This is a Django template that I personally use for my projects. This covers the following

  • Emails (and templated email designs)
  • Celery (For asynchronous tasks)
  • Celery Beat (For scheduled tasks)
  • Caching (via Redis)
  • Performance profiling (via Django Silk)
  • Selenium (Optional, for webscraping with support for Chrome and Firefox drivers)
  • Stripe Subscriptions (Optional, with regular and pro-rated subscription support)
  • Notifications (via traditional RESTful endpoints)
  • A working Woodpecker CI/CD template for automated deployments

A live API demo can be found here

Development

  • Create a copy of the .env.sample file and name it as .env in the same directory
  • Populate .env with values
  • Run docker-compose -f docker-compose.dev.yml up

When using docker-compose.dev.yml, the entire project directory is mounted onto the container allowing for hot-reloading. Make sure DEBUG is set to True for this to work! Be sure to follow through the steps shown in the stripe-listener container for initial setup with Stripe!

Deployment

A sample docker-compose.yml is provided which I use in hosting the demo. DEBUG should be set to False when deploying as to not expose the URLs fro Celery Flower and the Django Silk Profiler. The local Inbucket container is not present so make sure to specify an external SMTP server to process emails properly.

URLs