Wagtail modeltranslation doesn't work with DEBUG = False

390 Views Asked by At

I have a problem with absent redirection to the default language for the multilanguage wagtail site. If I set DEBUG = False on production, I got Internal server error, because redirection to url with language postfix is absent. If DEBUG = True everything works fine.

I'm using wagtail_modeltranslation

https://progtribe.com/ - doesn't work https://progtribe.com/uk - works

I use Wagtail, Gunicorn, Nginx

In my error logs I see only enter image description here

This log from gunicorn: enter image description here

If I set DEBUG = True then I get 302 status code and everything is works enter image description here

# urls.py
from django.conf.urls.i18n import i18n_patterns
urlpatterns = i18n_patterns(
    url(r'', include(wagtail_urls)),
    path('dj_admin/', admin.site.urls),
    url(r'^admin/', include(wagtailadmin_urls)),
    url(r'^documents/', include(wagtaildocs_urls)),
    url(r'^search/$', search_views.search, name='search'),
)
1

There are 1 best solutions below

1
On

I fixed this issue with delete 404.html and 500.html from the main templates folder.