help with localization
I tried adding localization middleware following your example here.
Viewing pages works fine now, but I noticed ajax requests still lead to POST /questions/123/vote/
, which then redirects (301) to GET en/questions/123/vote/
, which of course fails because vote
doesn't handle GET requests.
Any ideas where I went wrong in the settings? I am using askbot from the master branch of github.
My middleware settings:
MIDDLEWARE_CLASSES = (
#'django.middleware.gzip.GZipMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
#'django.middleware.cache.UpdateCacheMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'my_added.middleware.JinjaDjangoLocaleUrlMiddleware', # <------ added this one
'django.middleware.common.CommonMiddleware',
#'django.middleware.cache.FetchFromCacheMiddleware',
#'django.middleware.sqlprint.SqlPrintingMiddleware',
#below is askbot stuff for this tuple
'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
'askbot.middleware.pagesize.QuestionsPageSizeMiddleware',
'askbot.middleware.cancel.CancelActionMiddleware',
'django.middleware.transaction.TransactionMiddleware',
#'debug_toolbar.middleware.DebugToolbarMiddleware',
'askbot.middleware.view_log.ViewLogMiddleware',
'askbot.middleware.spaceless.SpacelessMiddleware',
)
Comments