First time here? Check out the FAQ!
0

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

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
schubert.konstantin's avatar
1
schubert.konstantin
asked 9 years ago

Comments

see more comments

1 Answer

0

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',
)

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
mrmartin's avatar
1
mrmartin
answered 9 years ago
link

Comments

see more comments