A simple Django 4 project with sane defaults to get you started. Powered by docker and compose.
- Configured with django-rest-framework and some useful plugins
- Separate configurations for local, dev and prod environments
- black and flake8 formatting and linting
- CI and tests using github actions, pytest and factory_boy
- redis caching in dev
- postgres db in dev
docker compose build
anddocker compose up
to run the project- Visit http://localhost:8080/admin/ to login using admin:secret as credentials
- Visit http://localhost:8080/api/v1/schema/swagger-ui for an auto-generated api documentation
- Connect to the container using
docker compose exec api bash
- Run tests in the container using
pytest
. - Create new apps in the container using
python manage.py startapp my_app
, then put inapps
folder, and change the name in the app'sapps.py
frommy_app
toapps.my_app
- Add new apps to config/settings/base.py, in the
LOCAL_APPS
list (ie."apps.my_app",
)
- Edit the DB_PREFIX value in config/settings/base.py to match your project
- To test with sensible credential information, create a
.env
, which is ignored in the .gitignroe file, and add it to the docker compose files as necessary. - Run using
docker compose -f docker-compose.dev.yml build
anddocker compose -f docker-compose.dev.yml up
- don't forget to reference test fixtures in conftest.py for pytest