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.2.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.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_describe-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ed5929808bc670e20c137e2ebd0bd4c97ac34c4ed9e7d65fbb19b4e5963abc83
MD5 4408f1c67666707d5c47087ac94475f4
BLAKE2b-256 8d4725b6f590adb6a7c9c6479d9f63e731505f274650812e33e04e6c8818edf4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_describe-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90e0332b612ea50edacc0f8ff748559f99464a78423012caacbd36fcb5a1d9a2
MD5 0e358e63857d02b5d1d0e96f2397e7c4
BLAKE2b-256 38379465573394f89485ef6451661999de3f7088f06ce415af7ea3c9bcb21417

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