我为什么会收到此 Django 错误?
我安装了一个名为 Django-notification 的应用程序,它使用 Django-pagination。但是,它找不到 Django_pagination 模板标签!
Exception Type: TemplateSyntaxError at /notifications
Exception Value: 'pagination_tags' is not a valid tag library: Template library pagination_tags not found, tried django.templatetags.pagination_tags,django.contrib.admin.templatetags.pagination_tags,django.contrib.humanize.templatetags.pagination_tags,pinax.templatetags.templatetags.pagination_tags
为什么?我已经安装了 Django 分页。它位于我的站点包中: django_pagination-1.0.7-py2.6.egg
接下来,我将“pagination”放入我的 INSTALLED_APPS 中。
我什至在我的views.py 中添加了分页。尽管我怀疑这会有所作为。
I installed an app called Django-notification, which uses Django-pagination. However, it can't find the Django_pagination template tags!
Exception Type: TemplateSyntaxError at /notifications
Exception Value: 'pagination_tags' is not a valid tag library: Template library pagination_tags not found, tried django.templatetags.pagination_tags,django.contrib.admin.templatetags.pagination_tags,django.contrib.humanize.templatetags.pagination_tags,pinax.templatetags.templatetags.pagination_tags
Why? I installed Django-pagination already. It's in my site-packages: django_pagination-1.0.7-py2.6.egg
Next, I put "pagination" in my INSTALLED_APPS.
I even imorted pagination in my views.py. Although I doubt that'll make a difference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是为了确保,您是否在模板中调用了
{% load pagination_tags %}
?来自 django 的文档:
Just to make sure, have you called
{% load pagination_tags %}
in your template?From django's documentation: