Reverse for 'pages-details-by-slug' with arguments '()' and keyword arguments '{'slug': ''}' not found.
See original GitHub issueI made a simple local test. Pages looks like this:
I request /de/blog/ and get the error:
Reverse for 'pages-details-by-slug' with arguments '()' and keyword arguments '{'slug': ''}' not found. 1 pattern(s) tried: ['en/(?P<slug>[0-9A-Za-z-_.//]+)/$']
The blog page looks like this:
So you see, the EN title & slug is empty. But the page is published in de and en. Maybe this is the error? But this should not happen, isn’t it?
complete traceback:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/de/blog/?edit&language=de
Django Version: 1.7.4
Python Version: 3.4.0
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'djangocms_admin_style',
'djangocms_text_ckeditor',
'menus',
'sekizai',
'mptt',
'djangocms_file',
'djangocms_link',
'djangocms_picture',
'djangocms_video',
'cmsplugin_htmlsitemap',
'cmsplugin_pygments',
'reversion',
'reversion_compare',
'compressor',
'django_extensions',
'filer',
'easy_thumbnails',
'cmsplugin_filer_image',
'parler',
'taggit',
'taggit_autosuggest',
'django_select2',
'meta',
'meta_mixin',
'admin_enhancer',
'djangocms_blog',
'django_info_panel',
'pylucid',
'example_project',
'debug_toolbar',
'pylucid_migration')
Installed Middleware:
('debug_toolbar.middleware.DebugToolbarMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware')
Template error:
In template /home/jens/page_instance_sqlite/example_project/templates/base.html, error at line 24
Reverse for 'pages-details-by-slug' with arguments '()' and keyword arguments '{'slug': ''}' not found. 1 pattern(s) tried: ['en/(?P<slug>[0-9A-Za-z-_.//]+)/$']
14 : <title>{% block title %}{% page_attribute page_title %}{% if site_settings.site.name %} - {{ site_settings.site.name }}{% endif %}{% endblock title %}</title>
15 :
16 : {% compress css %}
17 : <link href="{% static "css/bootstrap.min.css" %}" rel="stylesheet">
18 : <link href="{% static "css/styles.css" %}" rel="stylesheet">
19 : {% endcompress %}
20 : {% render_block "css" %}
21 : </head>
22 :
23 : <body>
24 : {% cms_toolbar %}
25 : <div class="container">
26 :
27 : <!-- Static navbar -->
28 : <div class="navbar navbar-default" role="navigation">
29 : <div class="container-fluid">
30 : <div class="navbar-header">
31 : <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
32 : <span class="sr-only"></span>
33 : <span class="icon-bar"></span>
34 : <span class="icon-bar"></span>
Traceback:
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
137. response = response.render()
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/response.py" in render
103. self.content = self.rendered_content
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/response.py" in rendered_content
80. content = template.render(context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/base.py" in render
148. return self._render(context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/test/utils.py" in instrumented_test_render
88. return self.nodelist.render(context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/base.py" in render
844. bit = self.render_node(node, context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/debug.py" in render_node
80. return node.render(context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/loader_tags.py" in render
126. return compiled_parent._render(context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/test/utils.py" in instrumented_test_render
88. return self.nodelist.render(context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/base.py" in render
844. bit = self.render_node(node, context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/debug.py" in render_node
80. return node.render(context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/classytags/core.py" in render
106. return self.render_tag(context, **kwargs)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/sekizai/templatetags/sekizai_tags.py" in render_tag
79. rendered_contents = nodelist.render(context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/base.py" in render
844. bit = self.render_node(node, context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/template/debug.py" in render_node
80. return node.render(context)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/classytags/core.py" in render
106. return self.render_tag(context, **kwargs)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/cms/templatetags/cms_tags.py" in render_tag
665. toolbar.populate()
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/cms/toolbar/toolbar.py" in populate
238. self._call_toolbar('populate')
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/cms/toolbar/toolbar.py" in _call_toolbar
285. result = getattr(toolbar, func_name)()
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/cms/cms_toolbar.py" in populate
107. self.add_language_menu()
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/cms/cms_toolbar.py" in add_language_menu
179. url = DefaultLanguageChanger(self.request)(code)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/menus/utils.py" in __call__
144. return '%s%s' % (self.get_page_path(lang), self.app_path)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/menus/utils.py" in get_page_path
111. return page.get_absolute_url(language=lang, fallback=True)
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/cms/models/pagemodel.py" in get_absolute_url
162. return reverse('pages-details-by-slug', kwargs={"slug": path})
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/core/urlresolvers.py" in reverse
551. return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File "/home/jens/PyLucid_env/lib/python3.4/site-packages/django/core/urlresolvers.py" in _reverse_with_prefix
468. (lookup_view_s, args, kwargs, len(patterns), patterns))
Exception Type: NoReverseMatch at /de/blog/
Exception Value: Reverse for 'pages-details-by-slug' with arguments '()' and keyword arguments '{'slug': ''}' not found. 1 pattern(s) tried: ['en/(?P<slug>[0-9A-Za-z-_.//]+)/$']
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Reverse for 'detail' with keyword arguments '{'slug': 'hello ...
When I used bellow RegEx to use as slug for details url I am getting this error. Would someone help me please to...
Read more >Reverse for 'pages-details-by-slug' with arguments ... - GitHub
I made a simple local test. Pages looks like this: I request /de/blog/ and get the error: Reverse for 'pages-details-by-slug' with arguments ......
Read more >reverse() function doesn't seem to take account of the includer ...
I have a urlconf being included from the top-level urlconf. the one being included is named, and I'm trying to get the reverse()...
Read more >Django Slug Tutorial | LearnDjango.com
How to add URL slugs to a Django project. ... We need to change that over to a keyword argument, kwargs , for...
Read more >Reverse for 'list' with arguments '()' and keyword ... - Treehouse
Reverse for 'list' with arguments '()' and keyword arguments '{}' not found. ... urlpatterns += staticfiles_urlpatterns(). app urls.py.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This still happens when you call
get_absolute_url
from shell when you have multilang slugs and you don’t specify a language for the method.The
get_language()
is supposed to be a fallback, butget_language()
returnsNone
in shell for understandable reasons. I would reopen this and add a check for the case whereget_language()
returns nothing.I could fix this by adding fallback languages to the cms-language settings. You need at least your primary language as fallback to the foreign languages in order to ne able to render the toolbar. For me site 3 had the problem. When you always edit and create english pages you need to put english to all other languages as fallback.