问题
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
This log from gunicorn:
If I set DEBUG = True then I get 302 status code and everything is works
# 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:
I fixed this issue with delete 404.html and 500.html from the main templates folder.
来源:https://stackoverflow.com/questions/63879245/wagtail-modeltranslation-doesnt-work-with-debug-false