E
E
Eugene5232019-12-20 09:56:01
Django
Eugene523, 2019-12-20 09:56:01

Is it possible to do without templates at all in Django?

I am new to web development. And my question is: Is it possible to do without templates in Django at all?
The fact is that before that I was learning Vue.JS and I would not want to interfere with Vue.JS with templates.
Is it possible to pass variables in JSON or something else?
I am not only interested in how this can be done, but also whether this solution is supported.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2019-12-20
@Eugene523

Certainly. Template rendering in Django is just one of the batteries you can use. In the Single Page Application world, no one uses this Django option, because the application only needs to get a set of "raw" data, mostly in JSON format. You can build your application to work with JSON using the standard Django methods, but the Django Rest Framework is best suited for this. DRF will allow you to write a working application for working with VueJS with a minimum amount of code. You will only need to focus on business logic, DRF will do the rest for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question