mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2025-10-25 07:04:54 +08:00
A Django REST Framework template for building RESTful APIs
| .bruno/drf_template | ||
| .docker | ||
| .woodpecker | ||
| src | ||
| .dockerignore | ||
| .env.sample | ||
| .gitignore | ||
| .python-version | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
DRF-Template
A barebones Django REST Framework template for personal use in projects.
- Pre-templated emails
- Caching via Redis
- Debug mode profiling (via Django Silk)
- Template CI/CD for automated builds/tests/linting/deployments (see service_queue for more info)
A live API demo can be found here
Development
- Create a copy of the
.env.samplefile and name it as.envin 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. This requires DEBUG to be set to True.
Also make 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 with DEBUG turned off so make sure to specify an external SMTP server to process emails properly.
URLs
- Django Admin Panel
- OpenAPI Swagger (For documenting endpoints)
- Inbucket (For email testing)
- Django Silk (For performance profiling)