A simple Django project that features a Cakes api
- Runs on Docker
- Provides a Swagger documentation
- Provides a Postman collection
- Python >= 3.11
- Docker
- Docker Compose
-
Clone the project
-
Cd into the project's directory
-
Copy the file
.env.dist
to a new file called.env
- the provided variables are enough to start with
-
Ensure Docker is up and running
-
Run the containers
$> docker compose up
- To seed some data, run
$> docker exec -it <container name> python manage.py test_seed
- Create a virtualenv
$> python -m venv .venv
- Activate the virtual environment
$> source .venv/bin/activate
- Install the required dependencies
$> python -m pip install -r requirements.txt
-
Open the
.env
file and change the value ofUSE_SQLITE
from 0 to 1 -
Run the migrations
$> python manage.py migrate
- Seed some data (use the
--wipe
option to wipe any existing database)
$> python manage.py test_seed [--wipe]
$> docker exec -it <container name> python manage.py test
$> python manage.py test
The documentation is available at http://localhost:8000/documentation/
in OpenAPI format using ReDoc
The app also comes supplied with Nginx and a second docker-compose file to use within a production environment. It will start a Gunicorn app
$> docker compose -f docker-compose-prod.yml up