Please refer to [this](http://stackoverflow.com/questions/40758711/how-to-set-a-default-handler-for-csrf-verification-failed-in-django) link for adding the error handler.
Please refer to this link for adding the error handler.