Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruslan-korneev/drf-postgres-backend-template
The template repo for backend on django, drf, postgres, redis. With CI: Linter, Pytest, Migrations-Check
https://github.com/ruslan-korneev/drf-postgres-backend-template
Last synced: 7 days ago
JSON representation
The template repo for backend on django, drf, postgres, redis. With CI: Linter, Pytest, Migrations-Check
- Host: GitHub
- URL: https://github.com/ruslan-korneev/drf-postgres-backend-template
- Owner: ruslan-korneev
- Created: 2023-03-08T15:45:10.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-26T21:13:33.000Z (over 1 year ago)
- Last Synced: 2024-12-24T07:59:47.377Z (8 days ago)
- Language: Python
- Homepage:
- Size: 86.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django REST with Postgres Template
# Installation and Running
## Using docker compose
```bash
# change variables values in .env files if you need
cp .env_samples/env.sample .env
cp .env_samples/db.env.sample db.env
cp .env_samples/redis.env.sample redis.envdocker compose up -d
```## Without docker compose for development
```zsh
python -m venv .venv
. .venv/bin/activate# run postgres and redis, and create .env file
cp .env_samples/env.sample .env # change variables values in .env filepoetry install
pre-commit install
dj migrate
dj runserver
```## Project's Structure
```
docker-compose.yaml
Dockerfile
entrypoint.sh
env_sample
poetry.lock
pyproject.toml
README.md
src
├── manage.py
├── urls.py
└── wsgi.py
├── settings
│ ├── __init__.py
│ ├── local.py
│ ├── spectacular.py
│ └── test.py
├── apps
│ ├── __init__.py
│ ├── your_app
│ │ ├── __init__.py
│ │ ├── models.py
│ └── └── ...
└── conftest.py
```## Django Settings
basic django settings located at `src/settings/__init__.py`
## Your Applications
you can collect you application modules inside src.apps package,
to include app:```python
INSTALLED_APPS = [
# django's
...,
# third party
...,
# your apps
"src.apps.my_app", # if app name is users - then use here "src.apps.users"
]
```# Continuous Integration
1. Tests: replace `echo` command with arguments to `pytest`. Pytest's settings are in [pyproject.toml](pyproject.toml)