Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8660867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:21:57+00:00 2026-06-12T16:21:57+00:00

when defining my javascript templates within <script type=text/template> </script> they don’t get rendered in

  • 0

when defining my javascript templates within

<script type="text/template">
</script>

they don’t get rendered in html (i don’t see them in the page, I mean) in my Django application. Maybe one of the filters / middlewares I’ve declared is opting them out?

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 to 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 **

My bad, the script tag was outside the main block and hence not rendered ¬_¬ … Thanks for letting me know about {{ verbatim }}, by the way

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:21:58+00:00Added an answer on June 12, 2026 at 4:21 pm

    Could I please see that template?

    If not – maybe you could use the escapejs-Filter or better the new verbatim tag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When defining a JavaScript call, like so: <input type=button onclick=someJavaScriptFunction /> What is the
Im having an issue defining the hit area for a javascript sliding element. See
What does the following javascript code mean? I guess it's defining a function within
I tried to hide elements in my html form by defining a javascript function
I'm just getting started defining and implementing external javaScript libraries and I'm a little
After defining the following : abstract class A { type T def print(p: T)
When defining parameter type that is e.g. in System.Data you have no intellisense and
Atleast defining my problem is simple... I have a Input control (Text) and a
What are the basic ways of defining reusable objects in Javascript? I say reusable
I'm starting learning javascript for a project, I've found a script that does a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.