Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install django-template-repl

How to install django-template-repl

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install django-template-repl
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.3.0 Available View build log
Windows (64-bit)
0.3.0 Available View build log
Mac OS X (10.5+)
0.3.0 Available View build log
Linux (32-bit)
0.3.0 Available View build log
Linux (64-bit)
0.3.0 Available View build log
 
Author
License
BSD
Lastest release
version 0.3.0 on Jan 5th, 2011

django-template-repl is a readline shell for the Django template language. It is similar to a CPython shell but it interprets template code instead of Python. It can be invoked either as a management command or with a templatetag.

To install, add 'template_repl' to your settings.INSTALLED_APPS.

The management command gives you quick access to the shell: python manage.py templateshell

You can pass a url to the management command to assume the context of a specific location: python manage.py templateshell -u /admin/foo/bar/

You can also provide context directly with a command line option. Here is an example of an interactive session: $ python manage.py templateshell -c "{'foo': 'FOO', 'bar': True}" >>> {% if bar %} ... {{ foo }} ... {% endif %} FOO >>>

The templateshell management command also has a --pdb option to allow you to load the context into a namespace and start a PDB debugger shell. This works in conjunction with the -u (--url) and -c (--context) commands. It also provides a "vars" list that shows the names of the context variables: $ python manage.py templateshell -u /admin/ --pdb ... ipdb> vars Out[0]: ['app_path', 'error_message', 'root_path', 'title', 'MEDIA_URL', 'LANGUAGES', 'LANGUAGE_BIDI', 'LANGUAGE_CODE', 'perms', 'messages', 'user'] ipdb> print user AnonymousUser

In addition, you can use the repl templatetag which creates a REPL that assumes the context of the caller template. This is basically "PDB for templates": {% load repl %}{% repl %}

You can also start a real PDB shell using the same tag by giving it a second argument of "pdb". This loads the contex into the PDB namespace: {% load repl %}{% repl pdb %}

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:5

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.