0

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'),
)
Anton Aks
  • 11
  • 3

1 Answers1

0

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

Anton Aks
  • 11
  • 3
  • If deleting 404.html / 500.html solves this, then it probably means those templates were throwing an error in the process of handling a 404/500 response - most likely, your base template is assuming the presence of variables such as `page` which aren't available in that situation. – gasman Nov 29 '20 at 22:00