Forums

Importing django.views.decorators.csrf causes error

I've had to add two lines above a view function to stop that csrf thing happening.

from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def view1(request):
    #etc etc

Unfortunately the line 'from django.views.decorators.csrf import csrf_exempt' gives me an API Error.

This doesn't happen on my home computer. I'm using django 1.4.3 at home and 1.3.7 on PythonAnywhere.

I'm loathe to update here unless I really have to because I'm convinced it will royally screw everything up.

But it seems this csrf_exempt thing has been there since 1.1.1, so I'm not sure why the error.

Okay, no, forget that. Thing started working somehow. Error due to something else. I have no idea what I'm doing.

I have no idea what I'm doing.

That's the way you learn! Keep up the good work :)