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)!
└── pyproject.toml # (5)!
- 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 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
│ ├── urls.py
│ └── wsgi.py
├── scripts/ # (4)!
│ └── convert.py
├── Dockerfile # (5)!
├── entrypoint.sh # (6)!
├── manage.py # (7)!
├── requirements.in # (8)!
├── requirements.txt # (9)!
└── setup.cfg # (10)!
- 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.
- Entrypoint script called by the Docker image.
- Django manage.py script. In nearly all cases, there's no good reason to change this. Just leave it alone.
- Requirements.in file used by
uv pip compile. See the uv tool for details. - Requirements.txt file generated by
uv pip install. Do not modify this file. Edit therequirements.infile instead. See the uv tool for details. - 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.