I am trying test some of the post methods in my Django app, but due to the csrf_token
, I can not test it without a browser. So I used
@csrf_exempt
decorator
However I forget to remove those decorators in production. Is there a better way like this?
@csrf_exempt(in_debug_only=True)
So like this decorator is active only when the application is in debug mode. Or is there a better way to test post requests?
Like selenium
might have some methods to do that?
Note: I m currently using Django 1.7.2 and Python 3.4.1