Each of the status codes has a specific meaning. See the List of HTTP status codes page on Wikipedia page for the meaning of each code.
You should choose an appropriate status code for each response. For example, you should only use 401
when the client is unauthorized. It's not a great idea to assign your own meanings to the status codes.
If you want to make it easier to detect the error, you could set a custom header instead:
response = HttpResponse()
response['My-App-Error'] = error_code
return response