Skip to main content

Django management commands used to output useful project information.

Project description

# Django Project Check

Django management command for monitoring file diffs.

## Compatibility

Supports Python 3.12+ and Django 5.2-6.0

## Background

With a large codebase, and a high velocity team making edits, it can be
difficult to keep track of how the codebase is changing over time. A
classic issue is people creating new modules / classes in unexpected
places, or ending up with a set of functions that should be in the same
place but are spread across multiple locations (often resulting in
`import` issues). In order to address this we build a small script to
parse the codebase and dump out a complete listing of all modules,
classes and functions. We commit this to the repo, and then run a CI
check to ensure that it's up to date. The net result is that each PR has
at least one file update which lists which functions have been edited,
and where. It's like a live update to the index.

This pattern - dump a text output and add a CI check to enforce its
correctness - turns out to be a really useful pattern for keeping
control of the codebase, and so we started adding new checks:

- Python functions
- Django URLs
- GraphQL schema
- FSM interactions

The original function check is a python script (using `ast`) and has no
requirement for the Django scaffolding, but the others do, and so they
run as management commands, which are then wrapped with a `git diff`
script:

```yaml
- name: Run freeze_django_urls and check for any uncommitted diff
run: |
python manage.py freeze_django_urls
git diff --exit-code 'django_urls.txt'
```

This project wraps this pattern into a base management command that can
be subclassed for any such requirement. All you need to do is provide a
function that returns the contents to be written to the file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_project_checks-0.5.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_project_checks-0.5.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file django_project_checks-0.5.0.tar.gz.

File metadata

  • Download URL: django_project_checks-0.5.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for django_project_checks-0.5.0.tar.gz
Algorithm Hash digest
SHA256 2d2388b28c60ccf82c9b02a2168c4f56fd9189ef1802d6a7b241ce9a6659861b
MD5 9abc54414de7addfb9d59b25af5ecfcb
BLAKE2b-256 b177642a665ca440b10c911d7d3e387021ead000d7bfa8eb649c0f0eabb1635e

See more details on using hashes here.

File details

Details for the file django_project_checks-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_project_checks-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ab55578b6ecabe4c11b3ecd1e215c25577c222d952d0bab856b7dcdf830bfbc
MD5 411f499b84066c4cbad1b18a71c36f95
BLAKE2b-256 176918059e0380128e99a326904e9fcc97c98477a2c018c8f61f10a4594ce8e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page