Ask Your Question
0

Where to place 'askbot.middleware.csrf.CsrfViewMiddleware' ?

asked 2015-06-21 07:28:22 -0600

schubert.konstantin gravatar image

When running 'python mange.py syncdb', the django self-check tells me the following:

 The order the middleware records is important, please take a look at the example in
 [I cannot post links]github.com/ASKBOT/askbot-devel/blob/master/askbot/setup_templates/settings.py:

'askbot.middleware.csrf.CsrfViewMiddleware',

The linked example does not contain 'askbot.middleware.csrf.CsrfViewMiddleware'. I tried to place it at the beginning or at the end of the middlware records, but the self-check kept telling me that the position is wrong

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-07-16 04:33:59 -0600

Hi,

You need to put this entry into the MIDDLEWARE classes section of settings.py.

MIDDLEWARE_CLASSES = (
    #'django.middleware.gzip.GZipMiddleware',
   ...
    'askbot.middleware.spaceless.SpacelessMiddleware',
    'askbot.middleware.csrf.CsrfViewMiddleware',
)
edit flag offensive delete link more

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: 2015-06-21 07:28:22 -0600

Seen: 32,347 times

Last updated: Jul 16 '15