miratcan / qhonuskan-votes

Simple reddit like voting system without usage off GenericForeignKeys. Built for linkfloyd project.
Other
30 stars 11 forks source link

403 Error when voting #5

Closed ghost closed 12 years ago

ghost commented 12 years ago

I installed this application alongside mine and I was receiving 403 errors when voting, receiving the error "CSRF token missing or incorrect.".

I added:

from django.views.decorators.csrf import csrf_exempt

to qhonuskan_votes/views.py

as well as:

@csrf_exempt

just above

def _api_view(func):

and it worked just fine.

miratcan commented 12 years ago

to solve csrf errors on ajax requests, i am using method that described django's documentation.

Disabling csrf checks is not healty solution.

ghost commented 12 years ago

Thank you! I appreciate your clarification.

miratcan commented 12 years ago

may be i should add this issue on documentation. :)

btw if you use qhonuskan-votes may be you can add your project here: https://github.com/miratcan/qhonuskan-votes/wiki/Projects-using-qhonuskan-votes