Opened 10 years ago

Closed 10 years ago

#21800 closed Bug (needsinfo)

CSRF middleware can't get POST data

Reported by: Türker Sezer Owned by: nobody
Component: Core (Other) Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have a django project which written with Django 1.3 and migrated to Django 1.6. CSRF middleware isn't in middleware list.

I get 403 (csrf) error from admin login page and all other forms. I use default admin login page and csrf value is in form and in cookie.

When i add a print line into csrf middleware, i can see that POST dict is empty. But if i add a print line into Common middleware, i can see POST data and CSRF middleware also works properly.

I can reproduce this error with nginx+uwsgi, only uwsgi and django development server.

Change History (3)

comment:1 by Claude Paroz, 10 years ago

It is not clear for me if the issue you report is when CSRF middleware is or is not in the middleware list in your settings. If it is not in that list, you should add it and the ticket is probably invalid. Please clarify...

comment:2 by Türker Sezer, 10 years ago

CSRF middleware doesn't affect this issue. I tried to use it, added it into middleware list but it didn't solve problem.

If i add line below into common middleware, everything works properly.

WORKAROUND = request.POST

comment:3 by Claude Paroz, 10 years ago

Resolution: needsinfo
Status: newclosed

I'm sorry, but I still cannot figure out what the problem is reading your description. Please give a more detailed explanation.

Note: See TracTickets for help on using tickets.
Back to Top