views:

3961

answers:

3

I have installed filebrowser for Django (not filebrowser3) and when I try to upload a file I recieve the following error:

403 Forbidden

CSRF verification failed. Request aborted.

More information is available with DEBUG=True.

The same error occurs when I try to create a new folder which shows that the problem is that filebrowser cannot create files/direcories within my uploads directory. I am using the default settings and have manually created the /media/uploads directory with it's permissions set as 755.

If I upload a file to the directory then file-browser admin page states:

1 Item Folder: 0 Image: 1

I cannot view the image that I have uploaded.

I have the PIL and sorl.thumbnail modules installed.

+4  A: 

You are probably using the development version of Django, which includes quite a lot of extra CRSF security. However it's not released yet so external products probably aren't compatible. You should use the 1.1 version of Django instead.

Daniel Roseman
Correct! I am struggling with downgrading to 1.1. Is there any way to resolve this issue besides waiting for the app to be updated? Thanks.
Pheter
A: 

The Djangodocs have more information about the new Django CSRF requirements:

fitzgeraldsteele
A: 

See here: http://docs.djangoproject.com/en/dev/ref/contrib/csrf/ like fitzgeralsteele said. Hugs.

Example: from django.views.decorators.csrf import csrf_exempt

@csrf_exempt def my_view(request): return HttpResponse(‘Hello world’)

Disable the CSRF middleware.

daniel rodrigues