Django and zinnia: NoReverseMatch for all views after upgrading -
i had zinnia
(0.14.1) working fine django
(1.6.6) app. upgraded django 1.8.0 , zinnia 0.15.1 , made several of required changes, including changing name of template tags zinnia_tags
zinnia
in custom templates.
i ran problem 'zinnia' not registered namespace
resolved making following change in project's main urls.py
:
# url(r'^blog/', include('zinnia.urls')), url(r'^blog/', include('zinnia.urls', namespace='zinnia')),
but i'm getting noreversematch
errors pages. example:
noreversematch: reverse 'zinnia_entry_archive_day' arguments '(u'2015', u'02', u'23')' , keyword arguments '{}' not found. 0 pattern(s) tried: []
and
noreversematch: reverse 'zinnia_tag_detail' arguments '(u'alumni',)' , keyword arguments '{}' not found. 0 pattern(s) tried: []
i can't figure out what's going on. setting have update?
turns out because had adapted , customized zinnia templates, , namespace had changed, had change syntax wherever url
call made. underscores become colons.
convert
<a href="{% url 'zinnia_tag_detail' tag %}" rel="tag">
and
<a href="{% url 'zinnia_entry_archive_year' date|date:"y" %}" rel="archives">{{ date|date:"y" }}</a>
to
<a href="{% url 'zinnia:tag_detail' tag %}" rel="tag">
and
<a href="{% url 'zinnia:entry_archive_year' date|date:"y" %}" rel="archives">{{ date|date:"y" }}</a>
Comments
Post a Comment