Because of the APPEND_SLASH = True
setting all requests with "/whatever/path" will be redirected to "/whatever/path/".
BUT urls definded within a i18n_patterns()
don't redirect for some reason
even the test works:
./runtests.py --settings=test_sqlite i18n.URLRedirectWithoutTrailingSlashTests
A trailing slash at the end of a URL on your website can cause issues with duplicate content if not dealt with correctly. Put simply, Google doesn't like seeing the same content on different pages. It can be confusing for both search engines and users.
Google does not care whether or not you use a trailing slash in your URLs. The thing that does matter is how you use them – Google counts each one as a different URL. https://www.example.com/safari and https://www.example.com/safari/ are two individual pages.
Historically, it's common for URLs with a trailing slash to indicate a directory, and those without a trailing slash to denote a file: http://example.com/foo/ (with trailing slash, conventionally a directory) http://example.com/foo (without trailing slash, conventionally a file)
Conventionally, a trailing slash (/) at the end of a URL meant that the URL was a folder or directory. At the same time, a URL without a trailing slash at the end used to mean that the URL was a file. However, this isn't how many websites are structured today.
it doesn't work properly if the middleware's aren't in order.
see: https://docs.djangoproject.com/en/1.5/topics/i18n/translation/#how-django-discovers-language-preference
that's how it should look like:
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
...
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With