2024-05-10 23:15:29 +08:00
## DRF-Template
2024-10-17 17:48:32 +08:00
![Build Status ](https://woodpecker.06222001.xyz/api/badges/2/status.svg )
2024-09-24 22:25:49 +08:00
![Demo Page Status ](https://stats.06222001.xyz/api/badge/119/status )
2024-08-30 19:28:24 +08:00
2024-05-10 23:46:48 +08:00
This is a Django template that I personally use for my projects. This covers the following
2024-05-10 23:15:29 +08:00
- Emails (and templated email designs)
- Celery (For asynchronous tasks)
- Celery Beat (For scheduled tasks)
2024-05-10 23:46:48 +08:00
- Caching (via Redis)
2024-05-10 23:15:29 +08:00
- 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)
2024-08-30 23:15:28 +08:00
- A working Woodpecker CI/CD template for automated deployments
2024-08-30 22:46:40 +08:00
2024-09-26 10:25:36 +08:00
A live API demo can be found [here ](https://api.template.06222001.xyz/api/v1/swagger )
2024-05-10 23:15:29 +08:00
2024-08-30 23:15:28 +08:00
### Development
2024-05-10 23:15:29 +08:00
- Create a copy of the `.env.sample` file and name it as `.env` in the same directory
- Populate .env with values
2024-08-30 22:46:40 +08:00
- Run `docker-compose -f docker-compose.dev.yml up`
2024-05-10 23:46:48 +08:00
2024-11-13 18:18:05 +08:00
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.
2024-09-06 23:35:31 +08:00
### Deployment
2024-11-13 18:18:05 +08:00
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.
2024-05-10 23:46:48 +08:00
2024-08-30 23:15:28 +08:00
### URLs
2024-05-10 23:46:48 +08:00
2024-09-25 19:47:09 +08:00
- [Django Admin Panel ](http://localhost:8000/api/v1/admin )
- [OpenAPI Swagger ](http://localhost:8000/api/v1/swagger ) (For documenting endpoints)
2024-05-10 23:46:48 +08:00
- [Inbucket ](http://localhost:8025 ) (For email testing)
2024-08-30 23:15:28 +08:00
- [Flower ](http://localhost:5555/ ) (For monitoring Celery tasks)
2024-09-25 19:47:09 +08:00
- [Django Silk ](http://localhost:8000/api/v1/silk ) (For performance profiling)