Language code twice in url

45 views
Skip to first unread message

Kaelig

unread,
Aug 30, 2018, 10:29:21 AM8/30/18
to Django users
Hi,

I'm building a multi language website using i18n. I get the language in the url with i18n_patterns :

urlpatterns = i18n_patterns(path('/contact/', views.contact, name='contact'), ...)


So I can access to my page with my-domain.com/en/contact/. But when I submit a form (or just try to acess it with a POST request), the url changes to my-domain.com/en/en/contact/ and then return a 404 error.

Any idea ?

Thanks for your help 
Kaelig

Kaelig

unread,
Aug 31, 2018, 10:49:53 AM8/31/18
to Django users
I think it has something to do with phusion passenger. It's skipping the first path item and merge it with the url.
Message has been deleted

Kaelig

unread,
Sep 4, 2018, 4:11:30 AM9/4/18
to Django users

error_message.png

Here is the error message I get


RONAK JAIN

unread,
Sep 4, 2018, 4:12:15 AM9/4/18
to django...@googlegroups.com
Please analyse your url mapping in django..

Thanks

On Tue, Sep 4, 2018 at 1:40 PM Kaelig <kael...@gmail.com> wrote:

error_message.png

Here is the error message I got from debug


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d6731f16-6c3e-4999-9ab2-411f080f6ff0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

RONAK JAIN

unread,
Sep 4, 2018, 4:13:59 AM9/4/18
to django...@googlegroups.com
okay one more thing you can do please go to settings and look there option DEBUG=False please do True.

On Tue, Sep 4, 2018 at 1:41 PM Kaelig <kael...@gmail.com> wrote:

error_message.png

Here is the error message I get


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Kaelig

unread,
Sep 4, 2018, 4:19:32 AM9/4/18
to Django users
Debug is already set to True.. Even if I only put one url in urlpatterns, I get this error. I don't think it's from a wrong url mapping. It looks like the path is empty even if it should not (it should be /aves/ in this case)

Kaelig

unread,
Sep 4, 2018, 4:21:39 AM9/4/18
to Django users
Why is it working with a GET and not a POST if my url mapping is wrong ??

RONAK JAIN

unread,
Sep 4, 2018, 4:24:29 AM9/4/18
to django...@googlegroups.com
I am not getting direct  error because more time you will get this type of error if you want to solve this one we can do connect on team viewer and then Maybe, I will solve your error.


Thanks
Ronak Jain  

Reply all
Reply to author
Forward
0 new messages