Getting an invalid block tag message Invalid block tag on line 2: 'out'. Did you forget to register or load this tag?
but don't know why. Here's my setup:
graphs.html
{% out %}
views.py
out = 'something to say'
template = loader.get_template('viz_proj/graphs.html')
context = {
'out' : out
}
return HttpResponse(template.render(context, request))
settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'viz_proj'
]
project heirarchy
viz_proj
|
viz_proj----------------------------------------templates
| |
settings.py--views.py--urls.py graphs.html
html" %} (with quotes) uses the literal value "base. html" as the name of the parent template to extend. {% extends variable %} uses the value of variable .
A Django template is a text document or a Python string marked-up using the Django template language. Some constructs are recognized and interpreted by the template engine. The main ones are variables and tags. A template is rendered with a context.
If the values of these variable are equal, the Django Template System displays everything between the {% ifequal %} block and {% endifequal %}, where the {% endifequal %} block marks the end of an ifequal template tag.
I think you want to try {{ out }} instead of {% out %}.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With