V
V
valexeich2022-02-03 23:10:11
Django
valexeich, 2022-02-03 23:10:11

How to make a frontend on DRF?

In normal django, you output data to the template using the context, for example, but how to output the necessary data to the template when using DRF? I’m watching videos about DRF and they receive data in json, but I didn’t find how to bring it to the front, so how do I do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2022-02-03
@valexeich

No way, Django is a backend.

K
kvarel, 2022-02-09
@kvarel

DRF has the concept of a renderer.
JSONRenderer generates a json response
BrowsableAPIRenderer generates a page on which we see the response display.
You should be interested in the TemplateHTMLRenderer. Read about him

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question