Closed niranjrajasekaran closed 9 years ago
hi, did you load the templatetags using {% load fontawesome %} ?
yes i have done it, i have declared {% load fontawesome %} in master and i extended the file in another file, then in the extended block i have used {% fontawesome_icon 'user' %}
I am using django 1.7
well, you need to load it in the child template, not the base one
Thanks @redouane it worked :)
~python~
Environment:
Request Method: GET Request URL: http://localhost:9900/
Django Version: 1.7.1 Python Version: 2.7.6 Installed Applications: ('grappelli', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'fontawesome', 'bootstrap3', 'website') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')
Template error: In template /home/niranj/Documents/personal/niranj-website/website/templates/website/index.html, error at line 5 Invalid block tag: 'fontawesome_icon', expected 'endblock' 1 : {% extends 'master.inc' %}
2 :
3 : {% block content %}
4 :
5 : {% fontawesome_icon 'user' %}
6 :
7 :
8 :
9 : {% endblock %}
10 :
11 :
Traceback: File "/home/niranj/Envs/niranj/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
Exception Type: TemplateSyntaxError at / Exception Value: Invalid block tag: 'fontawesome_icon', expected 'endblock' ~~