{"id":23554,"library":"djade","title":"djade","description":"A Django template formatter that ensures consistent formatting of Django templates. It supports Jinja2-style templates with Django tags and filters, and is designed to be fast and configurable. Current version is 1.9.0, released with regular updates.","status":"active","version":"1.9.0","language":"python","source_language":"en","source_url":"https://github.com/adamchainz/djade","tags":["django","template","formatter","linter","django-template"],"install":[{"cmd":"pip install djade","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"Djade","correct":"from djade import Djade"}],"quickstart":{"code":"from djade import Djade\nimport os\n\n# Simple usage: format a template string\nformatter = Djade()\ntemplate = \"\"\"{% load static %}\n<!DOCTYPE html>\n<html>\n<head>\n    <title>Test</title>\n</head>\n<body>\n    <h1>Hello</h1>\n</body>\n</html>\"\"\"\nformatted = formatter.format(template)\nprint(formatted)","lang":"python","description":"Basic usage of djade to format a Django template string."},"warnings":[{"fix":"Use a Jinja2-specific formatter like `djlint` for Jinja2 templates.","message":"djade only supports Django templates, not Jinja2 templates. Attempting to use it with Jinja2 may produce incorrect results or raise errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Set the environment variable or configure settings via `--settings` option if using CLI; in code, set `os.environ['DJANGO_SETTINGS_MODULE']` before using djade.","message":"djade relies on the `DJANGO_SETTINGS_MODULE` environment variable to be set when processing templates that use template tags from third-party apps. If not set, it may fail to resolve custom template tags.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from djade import Djade; formatter = Djade(); formatted = formatter.format(source)` instead of `djade.format_code(source)`.","message":"In version 1.0, the API changed from `djade.format_code()` to `Djade().format()`. Old code will break.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install djade`.","cause":"djade is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'djade'"},{"fix":"Set the `DJANGO_SETTINGS_MODULE` environment variable or configure Django settings manually before using djade.","cause":"Djade tries to configure Django settings when parsing templates with custom template tags, but no settings are configured.","error":"django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}