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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_describe-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2b3a17635f6d96ff72bc787c7bb2fb4c1a53288ecf925e4db8c4ad17d9397a37
MD5 98e750f38228cf82444481bb7819f7f0
BLAKE2b-256 1e7f1587a2d8cbabe134777170a0c93eda4d6264a724c31245b44853f9995c08

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_describe-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 59909f14fafce6f94e25a8beb94630bb28096a0be554a31913f3527782915b88
MD5 affd205edd21d513f816df581a9d362d
BLAKE2b-256 f72a1d4f276cdc2dc32d31a1ad40b7d3c7e6c30419d48b4d89c79bc1c177e10e

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