First time here? Check out the FAQ!
0

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',
)
piskvorky's avatar
350
piskvorky
asked 2011-11-14 13:05:58 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Hello, that example has differences not only in the settings.py file, that's why it is not enough to just modify the settings.py.

If you want to use the multilingual site, then take that whole branch for the starting point.

We are going to merge the current master branch into the multilingual version, probably within two weeks, you might want to wait until then.

Another option - start with a single language site meanwhile.

Evgeny's avatar
13.2k
Evgeny
answered 2011-11-14 17:46:02 -0600
edit flag offensive 0 remove flag delete link

Comments

Yes, I changed other things as well, but apparently not enough. I will wait for your official merge then, thanks.

piskvorky's avatar piskvorky (2011-11-15 01:47:18 -0600) edit
add a comment see more comments