https://github.com/prsvt420/django-app-template
Prepared Django template with customized technologies
https://github.com/prsvt420/django-app-template
black celery django docker docker-compose flake8 gunicorn isort mypy nginx poetry postgresql pre-commit python redis
Last synced: 3 months ago
JSON representation
Prepared Django template with customized technologies
- Host: GitHub
- URL: https://github.com/prsvt420/django-app-template
- Owner: prsvt420
- License: mit
- Created: 2025-02-08T13:04:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-29T04:37:03.000Z (about 1 year ago)
- Last Synced: 2025-03-29T05:24:56.417Z (about 1 year ago)
- Topics: black, celery, django, docker, docker-compose, flake8, gunicorn, isort, mypy, nginx, poetry, postgresql, pre-commit, python, redis
- Language: Python
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django app template
## Technologies and Tools
#### Programming Languages and Frameworks
- **Python 3.11**
- **Django 5**
### Development Tools
- **Mypy**
- **Flake8**
- **Black**
- **Isort**
- **Pre-commit**
- **Git**
- **GitHub**
- **Poetry**
### Databases
- **Redis**
- **PostgreSQL**
### Web Technologies
- **HTML**
- **CSS**
- **JavaScript**
- **JQuery**
### Server Technologies and Security
- **Gunicorn**
- **Nginx**
- **CSP**
- **HTTPS**
- **The nginx version is disabled**
### Containerization
- **Docker**
- **Docker Compose**
### Background Task Processing
- **Celery**
## Getting started
### 1. Create it .env at the root of the project:
```dotenv
# DJANGO SECRET KEY
SECRET_KEY=...
# DJANGO DEBUG
DEBUG=False
# DATABASE CONNECT SETTINGS
POSTGRES_DB=...
POSTGRES_USER=...
POSTGRES_PASSWORD=...
POSTGRES_HOST=database# docker container name
# REDIS CONNECT SETTINGS
REDIS_LOCATION=redis://redis:6379# redis container name
# SMTP
EMAIL_HOST_USER=...
EMAIL_HOST_PASSWORD=...
```
### 2. Add your IP and DOMAIN to the collection ALLOWED_HOSTS in setting.py and nginx/nginx.conf:
```python3.11
# django_app_template/setting.py
ALLOWED_HOSTS: List[str] = [
"127.0.0.1",
"YOUR IP",
"YOUR DOMAIN",
"YOUR www.DOMAIN"
```
### 3. Getting a certificate (at the first launch):
```shell
sudo docker run -it --rm \
-v "./nginx/certbot:/var/www/certbot" \
-v "/etc/letsencrypt:/etc/letsencrypt" \
certbot/certbot certonly \
--webroot \
--webroot-path=/var/www/certbot \
-d DOMAIN \
-d www.DOMAIN \
--email EMAIL \
--agree-tos \
--no-eff-email
```
**Note:** *You can only get a certificate when the server is running.*
### 4. It is necessary to uncomment parts of the code in nginx/nginx.conf. It is necessary to uncomment parts of the code in nginx/nginx.conf. Then rebuild docker compose:
```shell
sudo docker compose up --build
```