Is it possible to only accept requests that our coming from my applications? Say for example I have an iOS app called \'Best App\' and it uses Django as its backend. How can
Good application security solutions are non-trivial. You cannot use any simple, plain-text object like HTTP_USER_AGENT. One common approach is an "API Key" - where a key that is obtained from a registration page is supplied along with the request, but unless you combine this with some other "secret" it can be trivially copied and supplied by the "false" app.
One reasonably strong solution would be some form of challenge/response using a shared secret. A determined attacker could, theoretically, extract your secret from your app and use it, but that requires a reasonable deal of effort - first they need to decrypt your app bundle and then extract the secret. The flow is something like -
To protect this approach from man-in-the-middle attacks you need to run it over SSL and ensure that your app validates the server certificate.
You also should implement some form of protection against brute-force attempts, such as locking an API key after 'x' failed challenges