22๐
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.
8๐
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
.
1๐
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)
- PyCharm does not resolve templates nor template tags nor statics in Django project
- AuthAlreadyAssociated Exception in Django Social Auth
- Don't load 'initial_data.json' fixture when testing
1๐
I faced this problem yesterday. The Django-grapelli I used was the one that was included in the FileBrowser installation. I solved the problem by upgrading Django-grapelli. Just type:
pip install --upgrade django-grappelli
- Why save_model method doesn't work in admin.StackedInline?
- How to properly runserver on different settings for Django?
- Django admin enable sorting for calculated fields
0๐
I had a similar issue with urls and noticed that I need
{% load url from future %}
in the template if I want to have quoted url tags. Thatโs also mentioned in the official django documentation: https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#url
0๐
I seem to be encountering this same issue, but when I run the suggested console test I get this:
Python 2.7.9 (default, Apr 7 2015, 07:58:25)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.core.urlresolvers import reverse
>>> print reverse('grp_related_lookup')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/tsantor/.virtualenvs/project_env/lib/python2.7/site-packages/django/core/urlresolvers.py", line 579, in reverse
return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
File "/Users/tsantor/.virtualenvs/project_env/lib/python2.7/site-packages/django/core/urlresolvers.py", line 496, in _reverse_with_prefix
(lookup_view_s, args, kwargs, len(patterns), patterns))
NoReverseMatch: Reverse for 'grp_related_lookup' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
And my urls.py
looks like this:
urlpatterns = patterns(
# Admin
url(r'^grappelli/', include('grappelli.urls')),
url(r'^admin/', include(admin.site.urls), name="admin"),
# main views
#url(r'^$', RedirectView.as_view(url='/admin'), name='home'),
# API
url(r'^api/', include('api.urls', namespace='api')),
)
I also have the latest Grappelli (2.6.4) running on Django (1.8.2). By the way, it seems it only occurs when I try to access and add or edit view. The control panel and list views work.
0๐
I added
path('grappelli/', include('grappelli.urls')),
and fixed the problem.