Wagtail modeltranslation doesn't work with DEBUG = False

帅比萌擦擦* 提交于 2021-02-11 13:26:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!