Thursday, December 29, 2016

Re: django.template.exceptions.TemplateSyntaxError: 'static' is not a registered tag library. Must be one of:

Have you added django.contrib.staticfiles to INSTALLED_APPS in your settings.py?

On Thursday, December 29, 2016 at 11:30:16 AM UTC+1, ragini dahihande wrote:
Hello Guys,
I am new to django.
I created sample project while running it I am getting following error

django.template.exceptions.TemplateSyntaxError: 'static' is not a registered tag  library. Must be one of:

following is my index.html

{% load static %}

<link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}" />


{% if latest_question_list %}
   
<ul>
   
{% for question in latest_question_list %}
       
<li><a href ="{% url 'polls:detail' question.id %}">{{question.question_text}}</a></li>
   
{% endfor %}
   
</ul>
   
{% else %}
    <p> No polls are available</
p>
{% endif %}

Thanks,
Ragini

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6b9edfd2-f1ec-4302-b4a2-92b3aa094df6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment