Ask Your Question
0

help with localization

asked 2011-11-14 13:05:58 -0500

piskvorky gravatar image

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',
)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-11-14 17:46:02 -0500

Evgeny gravatar image

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.

edit flag offensive delete link more

Comments

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

piskvorky gravatar imagepiskvorky ( 2011-11-15 01:47:18 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-11-14 13:05:58 -0500

Seen: 131 times

Last updated: Nov 14 '11