Django markup templatetags error

元气小坏坏 提交于 2019-12-11 02:32:26

问题


I am getting the following errors in a django app:

TemplateSyntaxError at /
'markup' is not a valid tag library: Template library markup not found, tried django.templatetags.markup,django.contrib.admin.templatetags.markup

I have tried to following the solutions form this website which suggests that that 'django.contrib.markup' is missing from the INSTALLED_APPS list, but I already have it there.

I can import markdown from python manage.py shell so it is installed and is in the path.

I am using Django 1.3.

Here is the template:

{% load markup %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...

I just tried it again, and it works. Odd. I tried restarting the server before submitting the question, but I am not sure what is different now.


回答1:


Try calling render_to_response from python manage.py shell on the template in question, and please give a clip of the template file in question.

Fixed itself? Spooky. I hate those "fixes" because there's no guarantee that it won't break again or that the same "fix" will work again.

The only things I can think of there are:

  • Something had the old version cached
  • There was an old .pyc file laying around
  • Your server was trying to be clever
  • WSGI didn't reload the code or templates after you changed it


来源:https://stackoverflow.com/questions/6399649/django-markup-templatetags-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!