Project Structure¶
These are the directories and files in the project. Parts are summarized for clarity.
Top level¶
/
├── app/ # (1)!
├── docs/ # (2)!
├── scripts/ # (3)!
├── docker-compose.yml # (4)!
├── docker-compose-aws.yml # (5)!
└── pyproject.toml # (6)!
- The django project. This is also what goes into the Docker image when it's generated by
./scripts/buildrun.sh. See Django Project below for details. - Documentation for the project code. See Documentation below for details.
- Scripts used in the project. These are run in the commandline to do various project tasks. See Convenience Scripts for details.
- The docker compose file.
- The docker compose file for testing the AWS/production setup locally. See Test the AWS setup locally for details.
- The pyproject.toml file. This holds settings for project tools right now. We may combine this with
app/setup.cfgin the future. We may move this file intoapp/if it makes sense.
Django project¶
app/
├── core/ # (1)!
├── data/ # (2)!
├── peopledepot/ # (3)!
│ ├── asgi.py
│ ├── settings.py
│ ├── settings_aws.py
│ ├── urls.py
│ ├── urls_aws.py
│ └── wsgi.py
├── scripts/ # (4)!
│ └── convert.py
├── Dockerfile # (5)!
├── Dockerfile-aws # (6)!
├── entrypoint.sh # (7)!
├── entrypoint-aws.sh # (8)!
├── manage.py # (9)!
├── requirements.in # (10)!
├── requirements.txt # (11)!
├── requirements-aws.in # (12)!
├── requirements-aws.txt # (13)!
└── setup.cfg # (14)!
- The core app in django. This app contains the API and models. See Core App below for details.
- The data app in django. This app contains the initial data migrations. See Data App below for details.
- The django project configuration.
- Scripts used in the project. This currently contains the
convert.pyscript, which converts csv files into django initial data code. It's used to generate code for the initial data migrations. - Dockerfile used to build the Docker image.
- AWS/production Dockerfile. Uses
requirements-aws.txt, setsDJANGO_SETTINGS_MODULE, runscollectstatic, and starts gunicorn. - Entrypoint script called by the Docker image.
- AWS/production entrypoint script. Runs
migrate --noinputthen starts gunicorn on0.0.0.0:8000. - Django manage.py script. In nearly all cases, there's no good reason to change this. Just leave it alone.
- Development requirements source file used by
uv pip compile. Contains all dependencies including dev/test packages. See the uv tool for details. - Development requirements file generated from
requirements.in. Do not modify this file directly. Editrequirements.ininstead. See the uv tool for details. - AWS/production requirements source file. Contains only production dependencies — no dev or test packages.
- AWS/production requirements file generated from
requirements-aws.in. Do not modify this file directly. Editrequirements-aws.ininstead. - Config file for development support tools such as
flake8andpytest.flake8is the only tool that doesn't supportpyproject.tomlyet, which is why we have this file.
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/ # (11)!
├── tests/
│ ├── conftest.py # (12)!
│ ├── test_api.py # (13)!
│ ├── test_models.py # (14)!
│ └── test_permissions.py # (15)!
└── utils/ # (16)!
. └── jwt.py # (17)!
- Admin site configuration.
- Permission classes definitions.
- Serializers to control what data is sent to the client.
- Routes for the API.
- Views to retrieve data for the API.
- AppConfig for the core app.
- Initial data scripts. See Create initial data scripts for how to create these.
- Migration scripts. These are generated by the
makemigrationscommand. - File used by
django-linear-migrations. It stores the last migration name for the app for use in git merge conflicts. - Models for the core app.
- Scripts for the core app. We use it to hold temporary scripts in Create initial data migrations, but there's no need to commit them into git.
- Test fixtures file
- Test for the API
- Test for the models
- Test for the permissions
- Utility scripts for the core app
- Utility functions supporting JWT with Cognito
Data App¶
- Migration scripts. See Create initial data migrations for how to create these.
- File used by
django-linear-migrations. It stores the last migration name for the app for use in git merge conflicts.
Documentation¶
/
├── docs/
│ ├── [topics]/ # (1)!
│ ├── CONTRIBUTING.md # (2)!
│ ├── index.md # (3)!
│ ├── LICENSE # (4)!
│ ├── license.md # (5)!
│ └── _static/
├── CONTRIBUTING.md # (6)!
├── LICENSE # (7)!
├── mkdocs.yml # (8)!
└── README.md # (9)!
- Directories containing markdown files on different topics.
- Placeholder for the
CONTRIBUTING.mdfile in the project root. MkDocs requires all documentation files to be in thedocs/directory. This file uses a snippet to import the source content. - Home page of the documentation site. This files uses a snippet to import the
README.mdfile from the project root. - Placeholder
LICENSEfile. This file uses a snippet to import theLICENSEfile from the project root. This is used for linking from the Documentation Homepage as well as theREADME.mdfile in the Github web interface, which knows the file by this name only. - Placeholder
license.mdfile. This file uses a snippet to import theLICENSEfile from the project root. This is used for the MkDocs nav section, which requires themdfile extension. - Contributing file for the project. This name is capitalized according to Github conventions.
- Licence file for the project. This name is capitalized according to Github conventions.
- MkDocs config file.
- README file for the project. This name is capitalized according to Github conventions.