E
E
erastov2017-10-18 18:03:29
Django
erastov, 2017-10-18 18:03:29

How to create api in pure Django?

There is a task. It is necessary to create an API for a mobile application through which you can:
1 Log in to the application with a login and password
2 Get the current menu
3 Create orders
There is a strict rule - do not use the Django Rest Framework.
What are the best practices in terms of architecture?
I don’t really understand how views should look like with this approach. I just wrote several Django projects (with templates, etc., where the view gives the render of the template) and separately ran Django Rest Fraework (the simplest api with one label) and I don’t really understand how to use pure Django so that it works like Django Rest Framework and gave json to the request. A separate question is how to implement authorization with this approach.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton, 2017-10-18
Reytarovsky @Antonchik

"best practices" is not to write what has already been written.

A
Astrohas, 2017-10-18
@Astrohas

hmm most banal way to send json via http response

R
Roman Kitaev, 2017-10-18
@deliro

It is obvious that you need to write your own bicycle, which will partially duplicate DRF and then use it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question