Invalid block tag. Did you forget to register or download this tag?

Receiving 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 is 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 airhrchy

viz_proj
|
viz_proj----------------------------------------templates
    |                                              |
    settings.py--views.py--urls.py               graphs.html
+4
source share
2 answers

I think you want to try {{out}} instead of {% out%}.

+17
source

Solution {{out}}, not {% out %}. This is due to what outis a variable.

Link: https://docs.djangoproject.com/en/1.11/topics/templates/#the-django-template-language

+2
source

Source: https://habr.com/ru/post/1648848/


All Articles