Opinionated template repo to kickstart Back-end/API projects with Django Rest Framework.
- Makefile with common shorcuts for local development commands
- Authentication (Djoser)
- Registration
- Login
- Email validation
- Password reset (w/ email)
- Password reset confirmation
- Static file serving (Whitenoise)
- Dockerfile
- Docker compose for local development
- PostgreSQL
- Auto Swagger Docs (DRF Spectacular)
- Custom user model (email, password and name)
- Email via SMTP
- Pre-commit hooks (Ruff and OTB Pre-commit hooks)
- Automated testing (Pytest)
- Modal bakery
- Test run parallelization with (pytest-xdist)[https://pytest-xdist.readthedocs.io/]
- Faker
- Coverage
git clone [email protected]:laaraujo/django-api-template.git # clone this repo
cd django-api-template # cd into repository directory
python -m venv .venv # create virtual environment
source .venv/bin/activate # activate virtual environment
pip install -r requirements.txt # install dependencies
pre-commit install # initialize pre-commit hooks
cp .env.example .env # create .env file
make build # build containers
make run # run your containers locally
build .................... : Build local containers
run ...................... : Run local containers
stop ..................... : Stop local containers
down ..................... : Stop and delete local container
makemigrations ........... : Django makemigrations command
migrate .................. : Django migrate command
createsuperuser .......... : Django createsuperuser command
shell .................... : Django shell command
sh ....................... : SSH into local API container
linter ................... : Run Ruff linter against all files in this repo
Swagger docs are available in the /docs/
endpoint (http://localhost:8000/docs/).
403 Forbidden
response by default unless you are already logged in with an admin
account (http://localhost:8000/admin/).
If you want to change this behaviour you can modify the required permissions in ./src/app/urls.py