interstar
interstar

Reputation: 27166

Django : How can I see what custom tags have been defined?

I'm having trouble with a custom tag in Django.

Is there any way I can see a list of what custom tags have been defined and are currently registered?

Upvotes: 1

Views: 95

Answers (2)

tarequeh
tarequeh

Reputation: 1819

To list all currently active templatetags in django, execute the following in shell:

from django import template
for library in template.builtins:
    library.tags

This code basically loops through the django template libraries and print the tags attached to them, thereby showing the names for all template tags currently being used by django and also give you access to their respective functions.

Upvotes: 0

Raisins
Raisins

Reputation: 2848

The admin docs will show them all (I believe, need to double check) Here is a link telling you how to turn on admin docs in 1.0

Add django.contrib.admindocs to your INSTALLED_APPS list. Then add (r'^admin/doc/', include('django.contrib.admindocs.urls')), to your URL Conf file.

Upvotes: 1

Related Questions