Tip for debugging Django templates

Put this anywhere on your page:

<pre>{% filter force_escape %}{% debug %}{% endfilter %}</pre>
{#       //Move THIS open-comment line above the debug line to suppress.
         //Below to activate.
#}

Example output:

DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10,
                            'ERROR': 40,
                            'INFO': 20,
                            'SUCCESS': 25,
                            'WARNING': 30},
 'LANGUAGES': (('af', 'Afrikaans'),
               ('ar', 'Arabic'),
               ('ast', 'Asturian'),
               ('az', 'Azerbaijani'),
               ('bg', 'Bulgarian'),
               ('be', 'Belarusian'),
               ('bn', 'Bengali'),
               ('br', 'Breton'),
               ('bs', 'Bosnian'),
               ('ca', 'Catalan'),
               ('cs', 'Czech'),
               ('cy', 'Welsh'),
               ('da', 'Danish'),
               ('de', 'German'),
               ('el', 'Greek'),
               ('en', 'English'),
               ('en-au', 'Australian English'),
               ('en-gb', 'British English'),
               ('eo', 'Esperanto'),
               ('es', 'Spanish'),
               ('es-ar', 'Argentinian Spanish'),
               ('es-mx', 'Mexican Spanish'),
               ('es-ni', 'Nicaraguan Spanish'),
               ('es-ve', 'Venezuelan Spanish'),
               ('et', 'Estonian'),
               ('eu', 'Basque'),
               ('fa', 'Persian'),
               ('fi', 'Finnish'),
               ('fr', 'French'),
               ('fy', 'Frisian'),
               ('ga', 'Irish'),
               ('gl', 'Galician'),
               ('he', 'Hebrew'),
               ('hi', 'Hindi'),
               ('hr', 'Croatian'),
               ('hu', 'Hungarian'),
               ('ia', 'Interlingua'),
               ('id', 'Indonesian'),
               ('io', 'Ido'),
               ('is', 'Icelandic'),
               ('it', 'Italian'),
               ('ja', 'Japanese'),
               ('ka', 'Georgian'),
               ('kk', 'Kazakh'),
               ('km', 'Khmer'),
               ('kn', 'Kannada'),
               ('ko', 'Korean'),
               ('lb', 'Luxembourgish'),
               ('lt', 'Lithuanian'),
               ('lv', 'Latvian'),
               ('mk', 'Macedonian'),
               ('ml', 'Malayalam'),
               ('mn', 'Mongolian'),
               ('mr', 'Marathi'),
               ('my', 'Burmese'),
               ('nb', 'Norwegian Bokmal'),
               ('ne', 'Nepali'),
               ('nl', 'Dutch'),
               ('nn', 'Norwegian Nynorsk'),
               ('os', 'Ossetic'),
               ('pa', 'Punjabi'),
               ('pl', 'Polish'),
               ('pt', 'Portuguese'),
               ('pt-br', 'Brazilian Portuguese'),
               ('ro', 'Romanian'),
               ('ru', 'Russian'),
               ('sk', 'Slovak'),
               ('sl', 'Slovenian'),
               ('sq', 'Albanian'),
               ('sr', 'Serbian'),
               ('sr-latn', 'Serbian Latin'),
               ('sv', 'Swedish'),
               ('sw', 'Swahili'),
               ('ta', 'Tamil'),
               ('te', 'Telugu'),
               ('th', 'Thai'),
               ('tr', 'Turkish'),
               ('tt', 'Tatar'),
               ('udm', 'Udmurt'),
               ('uk', 'Ukrainian'),
               ('ur', 'Urdu'),
               ('vi', 'Vietnamese'),
               ('zh-cn', 'Simplified Chinese'),
               ('zh-hans', 'Simplified Chinese'),
               ('zh-hant', 'Traditional Chinese'),
               ('zh-tw', 'Traditional Chinese')),
 'LANGUAGE_BIDI': False,
 'LANGUAGE_CODE': 'en-us',
 'MEDIA_URL': '',
 'STATIC_URL': '/static/',
 'TIME_ZONE': 'UTC',
 'csrf_token': <django.utils.functional.lazy..__proxy__ object at 0xb5dc016c>,
 'messages': ,
 'perms': ,
 'user': <SimpleLazyObject: <function AuthenticationMiddleware.process_request.. at 0xb6766df4>>}{'form': ,
 'next': '/auth_lifecycle/',
 'site': ,
 'site_name': '127.0.0.1:8001'}{'False': False, 'None': None, 'True': True}

{'__future__': <module '__future__' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/__future__.py'>,
 '__main__': <module '__main__' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/bin/gunicorn'>,
 '_ast': <module '_ast' (built-in)>,
 '_bisect': <module '_bisect' (built-in)>,
 '_bootlocale': <module '_bootlocale' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/_bootlocale.py'>,
 '_bz2': <module '_bz2' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/lib-dynload/_bz2.cpython-34m-i386-linux-gnu.so'>,
 '_codecs': <module '_codecs' (built-in)>,
 '_collections': <module '_collections' (built-in)>,
 '_collections_abc': <module '_collections_abc' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/_collections_abc.py'>,
 '_compat_pickle': <module '_compat_pickle' from '/usr/lib/python3.4/_compat_pickle.py'>,
 '_datetime': <module '_datetime' (built-in)>,
 '_decimal': <module '_decimal' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/lib-dynload/_decimal.cpython-34m-i386-linux-gnu.so'>,
 '_frozen_importlib': <module 'importlib._bootstrap' (frozen)>,
 '_functools': <module '_functools' (built-in)>,
 '_hashlib': <module '_hashlib' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/lib-dynload/_hashlib.cpython-34m-i386-linux-gnu.so'>,
 '_heapq': <module '_heapq' (built-in)>,
 '_imp': <module '_imp' (built-in)>,
 '_io': <module 'io' (built-in)>,
 '_json': <module '_json' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/lib-dynload/_json.cpython-34m-i386-linux-gnu.so'>,
 '_locale': <module '_locale' (built-in)>,
 '_lzma': <module '_lzma' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/lib-dynload/_lzma.cpython-34m-i386-linux-gnu.so'>,
 '_markupbase': <module '_markupbase' from '/usr/lib/python3.4/_markupbase.py'>,
 '_opcode': <module '_opcode' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/lib-dynload/_opcode.cpython-34m-i386-linux-gnu.so'>,
 '_operator': <module '_operator' (built-in)>,
 '_pickle': <module '_pickle' (built-in)>,
 '_posixsubprocess': <module '_posixsubprocess' (built-in)>,

...

 'psycopg2._json': <module 'psycopg2._json' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/site-packages/psycopg2/_json.py'>,
 'psycopg2._psycopg': <module 'psycopg2._psycopg' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/site-packages/psycopg2/_psycopg.cpython-34m.so'>,
 'psycopg2._range': <module 'psycopg2._range' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/site-packages/psycopg2/_range.py'>,
 'psycopg2.extensions': <module 'psycopg2.extensions' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/site-packages/psycopg2/extensions.py'>,
 'psycopg2.tz': <module 'psycopg2.tz' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/site-packages/psycopg2/tz.py'>,
 'pwd': <module 'pwd' (built-in)>,
 'queue': <module 'queue' from '/usr/lib/python3.4/queue.py'>,
 'quopri': <module 'quopri' from '/usr/lib/python3.4/quopri.py'>,
 'random': <module 'random' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/random.py'>,
 're': <module 're' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/re.py'>,
 'reprlib': <module 'reprlib' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/reprlib.py'>,
 'resource': <module 'resource' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/lib-dynload/resource.cpython-34m-i386-linux-gnu.so'>,
 'select': <module 'select' (built-in)>,
 'selectors': <module 'selectors' from '/usr/lib/python3.4/selectors.py'>,
 'shutil': <module 'shutil' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/shutil.py'>,
 'signal': <module 'signal' (built-in)>,
 'site': <module 'site' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/site.py'>,
 'sitecustomize': <module 'sitecustomize' from '/usr/lib/python3.4/sitecustomize.py'>,
 'socket': <module 'socket' from '/usr/lib/python3.4/socket.py'>,
 'socketserver': <module 'socketserver' from '/usr/lib/python3.4/socketserver.py'>,
 'sre_compile': <module 'sre_compile' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/sre_compile.py'>,
 'sre_constants': <module 'sre_constants' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/sre_constants.py'>,
 'sre_parse': <module 'sre_parse' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/sre_parse.py'>,
 'ssl': <module 'ssl' from '/usr/lib/python3.4/ssl.py'>,
 'stat': <module 'stat' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/stat.py'>,
 'string': <module 'string' from '/usr/lib/python3.4/string.py'>,
 'stringprep': <module 'stringprep' from '/usr/lib/python3.4/stringprep.py'>,
 'struct': <module 'struct' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/struct.py'>,
 'subprocess': <module 'subprocess' from '/usr/lib/python3.4/subprocess.py'>,
 'symbol': <module 'symbol' from '/usr/lib/python3.4/symbol.py'>,
 'sys': <module 'sys' (built-in)>,
 'sysconfig': <module 'sysconfig' from '/usr/lib/python3.4/sysconfig.py'>,
 'tarfile': <module 'tarfile' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/tarfile.py'>,
 'tempfile': <module 'tempfile' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/tempfile.py'>,
 'textwrap': <module 'textwrap' from '/usr/lib/python3.4/textwrap.py'>,
 'threading': <module 'threading' from '/usr/lib/python3.4/threading.py'>,
 'time': <module 'time' (built-in)>,
 'token': <module 'token' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/token.py'>,
 'tokenize': <module 'tokenize' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/tokenize.py'>,
 'traceback': <module 'traceback' from '/usr/lib/python3.4/traceback.py'>,
 'types': <module 'types' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/types.py'>,
 'unicodedata': <module 'unicodedata' (built-in)>,
 'unittest': <module 'unittest' from '/usr/lib/python3.4/unittest/__init__.py'>,
 'unittest.case': <module 'unittest.case' from '/usr/lib/python3.4/unittest/case.py'>,
 'unittest.loader': <module 'unittest.loader' from '/usr/lib/python3.4/unittest/loader.py'>,
 'unittest.main': <module 'unittest.main' from '/usr/lib/python3.4/unittest/main.py'>,
 'unittest.result': <module 'unittest.result' from '/usr/lib/python3.4/unittest/result.py'>,
 'unittest.runner': <module 'unittest.runner' from '/usr/lib/python3.4/unittest/runner.py'>,
 'unittest.signals': <module 'unittest.signals' from '/usr/lib/python3.4/unittest/signals.py'>,
 'unittest.suite': <module 'unittest.suite' from '/usr/lib/python3.4/unittest/suite.py'>,
 'unittest.util': <module 'unittest.util' from '/usr/lib/python3.4/unittest/util.py'>,
 'urllib': <module 'urllib' from '/usr/lib/python3.4/urllib/__init__.py'>,
 'urllib.error': <module 'urllib.error' from '/usr/lib/python3.4/urllib/error.py'>,
 'urllib.parse': <module 'urllib.parse' from '/usr/lib/python3.4/urllib/parse.py'>,
 'urllib.request': <module 'urllib.request' from '/usr/lib/python3.4/urllib/request.py'>,
 'urllib.response': <module 'urllib.response' from '/usr/lib/python3.4/urllib/response.py'>,
 'uu': <module 'uu' from '/usr/lib/python3.4/uu.py'>,
 'warnings': <module 'warnings' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/warnings.py'>,
 'weakref': <module 'weakref' from '/home/jeffy/django_files/djauth_lifecycle_tutorial/part_06/dalt06_venv/lib/python3.4/weakref.py'>,
 'wsgiref': <module 'wsgiref' from '/usr/lib/python3.4/wsgiref/__init__.py'>,
 'wsgiref.handlers': <module 'wsgiref.handlers' from '/usr/lib/python3.4/wsgiref/handlers.py'>,
 'wsgiref.headers': <module 'wsgiref.headers' from '/usr/lib/python3.4/wsgiref/headers.py'>,
 'wsgiref.simple_server': <module 'wsgiref.simple_server' from '/usr/lib/python3.4/wsgiref/simple_server.py'>,
 'wsgiref.util': <module 'wsgiref.util' from '/usr/lib/python3.4/wsgiref/util.py'>,
 'xml': <module 'xml' from '/usr/lib/python3.4/xml/__init__.py'>,
 'xml.dom': <module 'xml.dom' from '/usr/lib/python3.4/xml/dom/__init__.py'>,
 'xml.dom.NodeFilter': <module 'xml.dom.NodeFilter' from '/usr/lib/python3.4/xml/dom/NodeFilter.py'>,
 'xml.dom.domreg': <module 'xml.dom.domreg' from '/usr/lib/python3.4/xml/dom/domreg.py'>,
 'xml.dom.minicompat': <module 'xml.dom.minicompat' from '/usr/lib/python3.4/xml/dom/minicompat.py'>,
 'xml.dom.minidom': <module 'xml.dom.minidom' from '/usr/lib/python3.4/xml/dom/minidom.py'>,
 'xml.dom.xmlbuilder': <module 'xml.dom.xmlbuilder' from '/usr/lib/python3.4/xml/dom/xmlbuilder.py'>,
 'zipfile': <module 'zipfile' from '/usr/lib/python3.4/zipfile.py'>,
 'zipimport': <module 'zipimport' (built-in)>,
 'zlib': <module 'zlib' (built-in)>}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s