0

Today, I added custom handler404 and it works properly, but there is one problem. I am using localization. Before adding custom 404 page, when I was going to mysite.com it was redirecting me mysite.com/en but now it throws 404 error. PS. It works properly when I am going to mysite.com/en

my project/urls.py file

urlpatterns += i18n_patterns(
    path("", include("geotravel_app.urls")),
    path("tours/", include("tours.urls")),
    path("guides/", include("guides.urls")),
    path('transport/', include('transport.urls')),
)

urlpatterns += [
    path('geotranslate/', include('rosetta.urls')),
]

handler404 = 'geotravel_app.views.error_404'

Thanks beforehand, sorry for my bad English.

1 Answers1

1

handler404 should return response with 404 status_code. Add 404 status code to your geotravel_app.views.error_404

Same issue was here:

Django locale enabled app always returns 404 when debug is off