L
L
Lopus2017-04-18 10:59:42
Django
Lopus, 2017-04-18 10:59:42

BrokenLink sending Internal error due to i18n redirect in Django?

Installed i18n on the site (LocaleMiddleware and i18n_patterns, etc.), everything works fine except for the constant spam from BrokenLinkEmailsMiddleware that someone went to a non-existent url (Broken INTERNAL link).
Here's what we managed to get to the bottom of:
The user opens example.com and follows the link to example.com/news, where he is met by LocaleMiddleware, which, in theory, should make a 302 redirect (to example.com/ru/news) before processing BrokenLinkEmailsMiddleware, but no . Apparently Django is finalizing all the middleware, BrokenLink sends its email and only then does Locale redirect.
How to cure it? maybe you need to add i18n for url (in templates) or what?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question