{"id":15634225,"url":"https://github.com/boxed/django-fastdev","last_synced_at":"2025-05-15T18:04:04.704Z","repository":{"id":41876610,"uuid":"285815781","full_name":"boxed/django-fastdev","owner":"boxed","description":"An app to make it safer, faster and more fun to develop in Django","archived":false,"fork":false,"pushed_at":"2025-05-15T07:35:39.000Z","size":115,"stargazers_count":191,"open_issues_count":17,"forks_count":15,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-15T18:03:58.351Z","etag":null,"topics":["django","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boxed.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-08-07T11:45:15.000Z","updated_at":"2025-05-15T07:35:44.000Z","dependencies_parsed_at":"2024-06-19T04:09:11.025Z","dependency_job_id":"b11da17e-728c-4756-b7fe-7f12b68b4e57","html_url":"https://github.com/boxed/django-fastdev","commit_stats":{"total_commits":95,"total_committers":14,"mean_commits":6.785714285714286,"dds":"0.42105263157894735","last_synced_commit":"7759b2b92c25a7e66417973b9db9ea33fc4b75da"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxed%2Fdjango-fastdev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxed%2Fdjango-fastdev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxed%2Fdjango-fastdev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxed%2Fdjango-fastdev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boxed","download_url":"https://codeload.github.com/boxed/django-fastdev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394720,"owners_count":22063984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","python"],"created_at":"2024-10-03T10:53:03.456Z","updated_at":"2025-05-15T18:04:04.698Z","avatar_url":"https://github.com/boxed.png","language":"Python","readme":"django-fastdev\n==============\n\n:code:`django-fastdev` is an app that makes it safer, faster and more fun to develop Django apps.\n\nFeatures\n--------\n\n\nError on non-existent template variables\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nDjango templates by default hide errors, and when it does show an error it's often not very helpful. This app changes this behavior to provide more informative error messages. For example, if you use:\n\n.. code:: html\n\n    {{ does_not_exist }}\n\ninstead of rendering that as an empty string, this app will raise a :code:`FastDevVariableDoesNotExist` error with a detailed message:\n\n.. code::\n\n    does_not_exist does not exist in context. Available top level variables:\n\n        DEFAULT_MESSAGE_LEVELS\n        False\n        None\n        True\n        bar\n        csrf_token\n        foo\n        messages\n        perms\n        request\n        user\n\nThere are more specialized error messages for accessing non-existent keys in a :code:`dict` or attributes of an object several levels deep, such as :code:`foo.bar.baz` (where :code:`baz` doesn't exist).\n\n**Handling `default` and `default_if_none` Filters**\n\nWhen using the :code:`default` or :code:`default_if_none` filters, :code:`django-fastdev` will not raise an exception for non-existent variables. Instead, it behaves as one might intuitively expect by populating the context variable with the result of the filter operation. For example:\n\n.. code:: html\n\n    {{ does_not_exist|default:\"N/A\" }}\n    {{ does_not_exist|default_if_none:\"\" }}\n\nIn these cases:\n  * If :code:`does_not_exist` is undefined, :code:`default:\"N/A\"` will render as :code:`N/A`, and :code:`default_if_none:\"\"` will render as an empty string (:code:`\"\"`).\n  * This ensures that templates using these filters handle missing variables gracefully, aligning with Django's built-in behavior while maintaining :code:`django-fastdev`'s strict checking for other cases.\n\nBy default, :code:`django-fastdev` only checks templates that exist within your project directory. To check ALL templates, including stock Django templates and templates from third-party libraries, add :code:`FASTDEV_STRICT_TEMPLATE_CHECKING = True` to your project :code:`settings.py`.\n\n\nImproved TemplateDoesNotExist errors\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nGood suggestions for what you wanted to do, and a complete list of all valid values makes it very easy to fix `TemplateDoesNotExist` errors.\n\n\nNoReverseMatch errors\n~~~~~~~~~~~~~~~~~~~~~\n\nHave you ever gotten this error?\n\n.. code::\n\n    django.urls.exceptions.NoReverseMatch: Reverse for 'view-name' with arguments '('',)' not found. 1 pattern(s) tried:\n\n\nIt's because you have :code:`{% url 'view-name' does_not_exist %}`. Django sees\n:code:`does_not_exist` and evaluates it to the empty string because it doesn't exist.\nSo that's why you get an error message that makes no sense. :code:`django-fastdev` will\nmake your code crash on the actual error: :code:`does_not_exist` doesn't exist.\n\n\nError if you have non-space text outside a block when extending\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nA common mistake for beginners that can be hard to spot is when they do:\n\n..  code-block:: html\n\n    \u003chtml\u003e\n        {% extends \"something.html\" %}\n        stuff here\n    \u003c/html\u003e\n\nDjango silently throws away :code:`stuff here` and :code:`\u003c/html\u003e`. :code:`django-fastdev` makes this an error.\n\n\nError on invalid block names when using :code:`{% extends \"...\" %}`\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you have a base template:\n\n..  code-block:: html\n\n    \u003chtml\u003e\n        \u003cbody\u003e\n            {% block content %}{% endblock %}\n        \u003c/body\u003e\n    \u003c/html\u003e\n\nand then write a template like this:\n\n..  code-block:: html\n\n    {% extends \"base.html\" %}\n\n    {% block contents %}\n        hello!\n    {% endblock %}\n\n\nDjango will silently throw away `hello!` because you wrote :code:`contents` instead\nof :code:`content`. :code:`django-fastdev` will turn this into an error which lists the\ninvalid and valid block names in alphabetical order.\n\n\nBetter error messages for reverse\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe standard error message for a bad :code:`reverse()/{% url %}` are rather sparse.\n:code:`django-fastdev` improves them by listing valid patterns so you can easily see\nthe problem.\n\n\nBetter error messages for QuerySet.get()\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe error message for :code:`QuerySet.get()` is improved to give you the query\nparameters that resulted in the exception.\n\n\nValidate clean_* methods\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nA common mistake is to make a form clean method and make a spelling error. By\ndefault Django just won't call the function. With :code:`django-fastdev` you will get\nan error message telling you that your clean method doesn't match anything.\n\nThis is also very useful during refactoring. Renaming a field is a lot safer\nas if you forget to rename the clean method :code:`django-fastdev` will tell you!\n\nBy default, :code:`django-fastdev` will check only forms that exist within your project,\nand not third-party libraries. If you would like to enable stricter validation that will\nextend to ALL forms, you can set this by configuring :code:`FASTDEV_STRICT_FORM_CHECKING`\nto :code:`True` in your Django settings.\n\n\nFaster startup\n~~~~~~~~~~~~~~\n\nThe initial model checks can be quite slow on big projects. :code:`django-fastdev`\nwill move these checks to a separate thread, so the runserver startup time is\nlowered, so you don't have to wait for the runserver restart as long.\n\n\nUsage\n------\n\nFirst install: :code:`pip install django-fastdev`\n\nIn :code:`settings.py` add :code:`django_fastdev` to INSTALLED_APPS:\n\n.. code:: python\n\n    INSTALLED_APPS = [\n        # ...\n        'django_fastdev',\n   ]\n\n\nEnjoy a nicer Django experience!\n\n\nLicense\n-------\n\nBSD\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboxed%2Fdjango-fastdev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboxed%2Fdjango-fastdev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboxed%2Fdjango-fastdev/lists"}