csrf_exempt must be approved in case of mobile authentication. If you also want to provide a web interface, you should separate the URL settings and avoid using csrf_exempt .
If you want to make your mobile auth more secure, I would create a hashed string from the device ID and a secret string stored both on your server and on your application. However, then you must also include the device identifier in your request in order to reproduce the hash on the server.
source
share