[Answered ]-REST API with Django Admin

1👍

To answer your question, no, I don’t think there are built-in solutions that cater to this. But that’s probably because your purpose is not a good fit for Django’s design and philosophy.

I’m with the comment by Sahil on this. I used to be paranoid about performance too, but I realized that I was underestimating Django’s speed (even with all these basic middleware), and that if performance was that critical, I probably shouldn’t be using Django in the first place. I’m guessing that disabling these middleware will save an app’s response time only unnoticeable milliseconds at most; inevitable network fluctuations might even be more significant. A developer’s time is more expensive than the additional hardware that could be thrown at any performance and/or scalability problems that come up.

But if you still want to save on the middleware processing, I have an alternative idea: the convenience functionality provided by the Django admin (that is, CRUD operations) could be replicated quite rapidly with DRF viewsets. Perhaps you could build a corresponding API client using some rapid-development frontend framework for your users. (I was going to say, just use the DRF browsable API, but I remembered that also relies on pretty much the same basic middleware as the Django admin.)

Leave a comment