I have a django app which has html templates and I also have a command line python api which can do GET and POST requests to the django app on the server. The api can pretty much do everything that the django app can do. How do I make it such that when I access the django app through the browser it returns html but when I access it through the api it returns json?
Where will I have to put the json and what changes do I have to make to my app?
Thank you