Skip to content

Project Structure

Top level

These are the directories files in the project. They are summarized for clarity.

.
├── app/     # (1)!
├── docs/    # (2)!
└── scripts/ # (3)!
docker-compose.yml
pyproject.toml
  1. The django project. This is also what goes into the Docker image when it's generated by ./scripts/buildrun.sh
  2. Documentation for the project.
  3. Scripts used in the project. These are run in the commandline to do various project tasks. See Convenience Scripts.
  4. The docker compose file.
  5. The pyproject.toml file.

Django project

app/
├── core/ # (1)!
├── data/ # (2)!
   └── migrations/
       ├── 0001_programarea_seed.py
       └── max_migration.txt
├── peopledepot/ # (3)!
   ├── asgi.py
   ├── settings.py
   ├── urls.py
   └── wsgi.py
├── scripts/ # (4)!
   └── convert.py
├── Dockerfile
├── entrypoint.sh*
├── manage.py*
├── requirements.in
├── requirements.txt
└── setup.cfg
  1. The core app in django. This app contains the API and models.
  2. The data app in django. This app contains the initial data migrations.
  3. The django project configuration.
  4. Scripts used in the project. This currently contains the convert.py script, which converts csv files into django initial data code. It's used to generate code for the initial data migrations.

core app

core/
├── admin.py # (1)!
├── api/
   ├── permissions.py # (2)!
   ├── serializers.py # (3)!
   ├── urls.py # (4)!
   └── views.py # (5)!
├── apps.py # (6)!
├── initial_data/
   ├── ...
   └── Initial data in json or csv format # (7)!
├── migrations/
   ├── nnnn_migration_name.py # (8)!
   ├── ...
   └── max_migration.txt # (9)!
├── models.py # (10)!
├── scripts/
   ├── ...
   └── table_name_seed.py # (11)!
├── tests/
   ├── conftest.py # (12)!
   ├── test_api.py # (13)!
   ├── test_models.py # (14)!
   └── test_permissions.py # (15)!
└── utils/ # (16)!
└── jwt.py
  1. Admin site configuration.
  2. Permission classes definitions.
  3. Serializers to control what data is sent to the client.
  4. Routes for the API.
  5. Views to retrieve data for the API.
  6. AppConfig for the core app.
  7. Initial data scripts. See Create initial data scripts.

data app

data/
└── migrations/ # (1)!
   ├── nnnn_migration_name.py # (1)!
   ├── ...
   └── max_migration.txt # (1)!

Documentation

docs/
├── architecture/
   ├── authentication.md
   ├── github_actions.md
   ├── Notes.md
   └── project_structure.md
├── CONTRIBUTING.md
├── how-to/
   ├── add-model-and-api-endpoints.md
   ├── create-initial-data-migrations.md
   └── run-local.md
├── index.md
├── LICENSE
├── license.md
├── _static/
└── tools/
├── docker.md
├── mkdocs.md
├── pre-commit.md
├── scripts.md
└── uv.md
CONTRIBUTING.md
LICENSE
mkdocs.yml
README.md

Convenience scripts

scripts/
├── buildrun.sh*
├── check-migrations.sh*
├── createsuperuser.sh*
├── db.sh*
├── erd.sh*
├── lint.sh*
├── loadenv.sh*
├── logs.sh*
├── migrate.sh*
├── precommit-check.sh*
├── run.sh*
├── start-local.sh*
├── test.sh*
└── update-dependencies.sh*