V
V
Vitaly2015-07-06 09:26:56
Django
Vitaly, 2015-07-06 09:26:56

Django link, how to correctly describe a link for a plugin?

Hello, there is a news plugin cmsplugin_newsplus, the installation and work goes well, but when I go to the news, I get a 404 error4c7c4ed05c304f38b75fab7eb2efb733.png

Request Method:	GET
Request URL:	http://127.0.0.1:8000/en/en/news/2015/07/05/123/
Using the URLconf defined in news.urls, Django tried these URL patterns, in this order:
^media/(?P<path>.*)$
^static\/(?P<path>.*)$
^en/ ^admin/
^en/ ^sitemap\.xml$
^en/ ^select2/
^en/ ^ ^(?P<slug>[0-9A-Za-z-_.//]+)/$ [name='pages-details-by-slug']
^en/ ^ ^$ [name='pages-root']
^en/ ^news/
The current URL, /en/en/news/2015/07/05/123/, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

The urls file has, as described in the documentation, the line
url(r'^news/', include('cmsplugin_newsplus.urls')),

I tried to change its contents, but did not get a working result.
How to modify the line so that it works in my situation?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tplus, 2015-07-06
@tplus

You have /en/en in the address bar, although, most likely, it should just be /en - is the link formed incorrectly somewhere?

I
Igor Lyutoev, 2015-07-06
@loader777

Show what you have in cmsplugin_newsplus/urls.py

D
denizen, 2015-07-06
@denizen

Try turning off the middleware one by one and see what has changed. Perhaps some kind of middleware suits you. Start with django-cms.cms.middleware.language

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question