Package: django-fastdev
django-fastdevis an app that makes it faster and more fun to develop Django apps.FeaturesError on non-existent template variablesDjango templates by default hide errors, and when it does show an error it’s often not very helpful. This app will change this so that if you do:{{ does_not_exist }}instead of rendering that as an empty string, this app will give you an error message:does_not_exist does not exist in context. Available top level variables:

    DEFAULT_MESSAGE_LEVELS
    False
    None
    True
    bar
    csrf_token
    foo
    messages
    perms
    request
    userThere are more specialized error messages for when you try to access the contents of adict, and attributes of an object a few levels deep likefoo.bar.baz(where baz doesn’t exist).By default,django-fastdevonly checks templates that exist within your project directory. If you want it to check ALL templates, including stock django templates and templates from third party libraries, addFASTDEV_STRICT_TEMPLATE_CHECKING = Trueto your projectsettings.py.NoReverseMatch errorsHave you ever gotten this error?django.urls.exceptions.NoReverseMatch: Reverse for 'view-name' with arguments '('',)' not found. 1 pattern(s) tried:It’s because you have{% url 'view-name' does_not_exist %}. Django seesdoes_not_existand evaluates it to the empty string because it doesn’t exist.
So that’s why you get an error message that makes no sense.django-fastdevwill
make your code crash on the actual error:does_not_existdoesn’t exist.Error if you have non-space text outside a block when extendingA common mistake for beginners that can be hard to spot is when they do:<html>{% extends "something.html" %}
    stuff here</html>Django silently throws awaystuff hereand</html>.django-fastdevmakes this an error.Error on invalid block names when using{% extends "..." %}If you have a base template:<html><body>{% block content %}{% endblock %}</body></html>and then write a template like this:{% extends "base.html" %}

{% block contents %}
    hello!
{% endblock %}Django will silently throw awayhello!because you wrotecontentsinstead
ofcontent.django-fastdevwill turn this into an error which lists the
invalid and valid block names in alphabetical order.Better error messages for reverseThe standard error message for a badreverse()/{% url %}are rather sparse.django-fastdevimproves them by listing valid patterns so you can easily see
the problem.Better error messages for QuerySet.get()The error message forQuerySet.get()is improved to give you the query
parameters that resulted in the exception.Validate clean_* methodsA common mistake is to make a form clean method and make a spelling error. By
default Django just won’t call the function. Withdjango-fastdevyou will get
an error message telling you that your clean method doesn’t match anything.This is also very useful during refactoring. Renaming a field is a lot safer
as if you forget to rename the clean methoddjango-fastdevwill tell you!Faster startupThe initial model checks can be quite slow on big projects.django-fastdevwill move these checks to a separate thread, so the runserver startup time is
lowered, so you don’t have to wait for the runserver restart as long.UsageFirst install:pip install django-fastdevInsettings.pyadddjango_fastdevto INSTALLED_APPS:INSTALLED_APPS=[# ...'django_fastdev',]Enjoy a nicer Django experience!LicenseBSD