When I define my JavaScript templates within:
<script type="text/template">
</script>
they are not rendered in the HTML (I don't see them on the page) in my Django application. Could one of the filters or middlewares I have declared be excluding them?
This is from settings.py
COMPRESS_PRECOMPILERS = (
('text/less', 'lessc {infile} {outfile}'),
)
if DEBUG:
COMPRESS_REBUILD_TIMEOUT = 1
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages",
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
If so, how can I solve this?
EDIT The template:
<script type="text/template" id="new-catalog-template">
<div class="catalog" data-id="<%= responseJSON.catalog.id %>" style="display: none">
<div class="catalog-main-content">
<div class="preview"><img src="<%= responseJSON.user_dir %>/catalogs/<%= responseJSON.catalog.id %>/ipad-preview-icon-large.png" alt="" /></div>
<div class="name"><%= responseJSON.catalog.name %></div>
<div class="last-build"><em>Last build:</em><%= responseJSON.catalog.last_build_natural %> (<%= responseJSON.catalog.last_build %>)</div>
<div class="description"><%= responseJSON.catalog.description %></div>
</div>
</div>
</script>
** EDIT EDIT **
Oops, the script tag was outside the main block and therefore not rendered ¬_¬ ... Thank you for mentioning {{ verbatim }}
, by the way