Django-grappelli admin: No reverse match error
I encountered the same behavior with Django 1.5 and Grappelli 2.4.4.
To fix the problem I had to add
url(r'^grappelli/', include('grappelli.urls')),
to urlpatterns
.
I faced with this problem today, when I tried to delete data in admin.Reverse for 'app_list' with arguments '()' and keyword arguments '{'app_label': ''}' not found.
I have put the url(r'^grappelli/', include('grappelli.urls'))
in urls.py
The solution is pretty strange: just update the grappelli to the latest version. (I updated it from 2.5.6 to 2.6.3)
Do you still have 'grappelli.urls'
included in your URLconf? That the only reason I see that would cause this error. You can try using python manage.py shell
:
from django.core.urlresolvers import reverse
print reverse('grp_related_lookup')
If this line returns the correct URL, you shouldn't get a NoReverseMatch
in your template.
The quotes around grp_related_lookup
shouldn't be a concern. The {% url %}
tag accepts both quoted and unquoted strings as first argument, so django normalizes it to quoted strings. This behaviour is going to change in the future: you'll be able to pass template variables to {% url %}
using unquoted strings. {% url foo %}
and {% url "foo" %}
won't give the same result, see the 1.3 release notes for details about this.