https://github.com/lordksix/django-template
Template to create a containerized Django app with PostgreSQL, Celery, RabbitMQ and Redis
https://github.com/lordksix/django-template
celery django postgresql rabbitmq redis
Last synced: about 2 months ago
JSON representation
Template to create a containerized Django app with PostgreSQL, Celery, RabbitMQ and Redis
- Host: GitHub
- URL: https://github.com/lordksix/django-template
- Owner: lordksix
- License: gpl-3.0
- Created: 2023-12-23T14:18:19.000Z (over 1 year ago)
- Default Branch: dev
- Last Pushed: 2024-01-02T09:51:02.000Z (over 1 year ago)
- Last Synced: 2024-05-17T15:48:25.397Z (about 1 year ago)
- Topics: celery, django, postgresql, rabbitmq, redis
- Language: Python
- Homepage:
- Size: 67.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Template by lordksix
## Instructions
- This is a template to create a containerized Django application with PostgreSQL as a database, Celery and Rabbit MQ to handle and schedule tasks, Channels for WebSockets, Uvicorn for ASGI, Redis as a cache and final result for tasks, and Nginx as a reverse proxy.
1. Need to have install python install on your machine, create a virtual environment and run the following command:
```bash
pip install -r requirements.txt
```**Do not forget to get the you agree with the version on the requirements, if not you can change it or update afterwards and refreeze.**
2. Run the following command and update accordingly:
```bash
cp .env.example .env
```- Update COMPOSE_FILE accordingly:
For production```bash
./.docker/docker-compose.yml:./.docker/docker-compose.prod.yml
```For development
```bash
./.docker/docker-compose.yml:./.docker/docker-compose.dev.yml
```3. Update Dockerfile and docker-compose files accordingly
4. Run the following command:
```bash
cp .env.example .env
```and update accordingly
5. To run locally, you need to have docker install. You must run the following command from the root directory:
```bash
docker compose up -d --build
```and go to localhost:8000
6. To run django commands, such as the ones listed below, you can do it inside the DJANGO container or first the following command:
```bash
docker exec -it django-template-backend /bin/sh
```- To create a new super user:
```bash
python manage.py createsuperuser
```- To run tests:
```bash
python manage.py test
```- To stop running the app run the following commands
```bash
docker compose stop
```- To delete containers run the following commands
```bash
docker compose down
```