Skip to main content

Generate reports containing information on the runtime configuration of a Django site, after everything has been loaded or created and initialised.

Project description

django-describe

django-describe generates a report on the run-time configuration of a Django site after everything has been loaded or created and initialised- generating lists of installed apps, models registered with the Django Admin, urls served, etc. The reports are generated in json format.

The reports are the metadata for a site. You can use the reports for anything, but the reason django-describe was created was to feed the information into an LLM to generate tests.

Usage

Generate a complete report using the following:

python manage.py describe

Reports, by default, are written to the console, but you can save them to a file either by redirecting the output, or using the --output option:

python manage,py describe --output metadata/description.json

Output

django-describe generates the report in JSON format:

{
    "apps": [
        "django.contrib.admin",
        "django.contrib.auth",
        "django.contrib.contenttypes",
        "django.contrib.sessions",
        "django.contrib.messages",
        "django.contrib.staticfiles",
        "describe"
    ],
    "models": [
        "admin.logentry",
        "auth.permission",
        "auth.group",
        "auth.user",
        "contenttypes.contenttype",
        "sessions.session"
    ],
    "settings": {
        "ABSOLUTE_URL_OVERRIDES": {},
        "ADMINS": [],
        "ALLOWED_HOSTS": [],
        "APPEND_SLASH": true,
        "AUTHENTICATION_BACKENDS": [
            "django.contrib.auth.backends.ModelBackend"
        ],
        ...
    }
}

Note: The report normally does not include information from dependencies. They were only included as the django-describe app does not include any models.

Install

You can use either pip or uv to download the package from PyPI and install it into a virtualenv:

pip install django-describe

or:

uv add django-describe

Update INSTALLED_APPS in your Django setting:

INSTALLED_APPS = [
    ...
    "describe",
]

Demo

If you check out the code from the repository there is a fully functioning, but minimal Django site, which you can used to see how the management command works.

git clone git@github.com:StuartMacKay/django-describe.git
cd django-describe

Create the virtual environment:

uv venv

Activate it:

source .venv/bin/activate

Install the requirements:

uv sync

Run the database migrations:

python manage.py migrate

Now, run the management command to generate the report:

python manage.py describe --output metadata.json

Project Information

The app is tested on Python 3.12+, and officially supports Django 5.2 LTS, and later versions.

License

django-describe is released under the terms of the MIT license.

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_describe-0.0.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

django_describe-0.0.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file django_describe-0.0.3.tar.gz.

File metadata

  • Download URL: django_describe-0.0.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_describe-0.0.3.tar.gz
Algorithm Hash digest
SHA256 549f8d2ae24de37496aabe07b4ba71ed4a33b82c58fe1f65ca198d570ad04861
MD5 0166606b4685ac8d0afe367b2a45ba54
BLAKE2b-256 7469dba8d8630da19b3fb7411ed8d079b1d69dc3c5e923ba1581cced6c553642

See more details on using hashes here.

File details

Details for the file django_describe-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: django_describe-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_describe-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f993b8de4ffd0fead69c808f0cce4285ad918fa6653afacfd5b8d61f36bf7f08
MD5 2e90567b1ca18989f67f97a33b63e726
BLAKE2b-256 439a0e1addefbaa402ac13e291b7316450afb05ad7a0c5d3296284c720924b92

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