nephila / djangocms-blog

django CMS blog application - Support for multilingual posts, placeholders, social network meta tags and configurable apphooks
https://djangocms-blog.readthedocs.io
BSD 3-Clause "New" or "Revised" License
403 stars 190 forks source link

NoReverseMatch for Translation #659

Open whyronimus opened 3 years ago

whyronimus commented 3 years ago

I am trying to provide a two-language version of a djangocms-blog I set up.

Steps to reproduce:

Versions

Django CMS 3.5.3 Django 1.11 Python 3.6.7

Expected behaviour

Both Blog pages should display overview of blog entries

Actual behaviour

Default language (language in which the blog entries were created in) shows up, when I switch to second language it throws a NoReverseMatch Error:

Reverse for 'post-detail' not found. 'post-detail' is not a valid view function or pattern name.

Additional Information

setup.py:

LANGUAGES = ( ('de', gettext('de')), ('en', gettext('en')), )

CMS_LANGUAGES = { 1: [ { 'code': 'de', 'name': gettext('de'), 'redirect_on_fallback': True, 'public': True, 'hide_untranslated': False, }, { 'code': 'en', 'name': gettext('en'), 'redirect_on_fallback': True, 'public': True, 'hide_untranslated': False, }, ],
'default': { 'redirect_on_fallback': True, 'public': True, 'hide_untranslated': False, }, }

urls.py:

urlpatterns = [ url(r'^sitemap.xml$', sitemap, {'sitemaps': {'cmspages': CMSSitemap}}), ]

urlpatterns += i18n_patterns( url(r'^admin/', include(admin.site.urls)), # NOQA url(r'^', include('cms.urls')), url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')), )

if settings.DEBUG: urlpatterns = [ url(r'^media/(?P.*)$', serve, {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), ] + staticfiles_urlpatterns() + urlpatterns

yakky commented 3 years ago

@whyronimus thanks for the report, which are the djangocms-blog and django-parler in the virtualenv? the root issue is the page not being published in the second language: are all the ancestors of the blog page published on all the languages Namespace is the same for all the languages, so this is normal

TLuesebrinck commented 2 years ago

Had exact this problem. In my case the menu/page item with the Blog/News app hock was not published for the German language. After fixing this it works.