T
T
tupoi2016-10-16 18:42:53
Django
tupoi, 2016-10-16 18:42:53

How to make Django return html page?

Good afternoon, there is a test project that is written in Django, the frontend is written in Angularjs, how to make it so that when you go to "127.0.0.1:8000/" Django sends us an html page?
in views.py prescribed

class RootView(TemplateView):
    template_name = "front/index2.html"

in urls.py But when navigating to the address, an error appears
url(r'^$', views.RootView.as_view()),
TemplateDoesNotExist at /
front/index2.html

If I open the html file manually when Django is running, then everything works, the data is received

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Abdulla Mursalov, 2016-10-16
@amaprograma

Obviously, the problem is with connecting the templates folder. In general, it is not very correct to give away Angular in this way. Leave this task to nginx.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question