Home Loading templates in Django doesn't work
Reply: 0

Loading templates in Django doesn't work

user902
1#
user902 Published in May 21, 2018, 9:18 am

I have a project that has 3 apps: app1, app2 and app3. In the first two apps I had different templates: app1/templates/app1/page.html

app2/templates/app2/anotherpage.html

And I load them like this:

return render(request, "app1/page.html")

It worked perfectly, but now I added app3, and I tried to do the same:

app3/templates/app3/config.html

but when I return app3/config.html I get the error TemplateDoesNotExist

I simply created the app doing python manage.py startapp app3 and copy the files to the folder. I also added the app to the INSTALLED_APPS list. However, this works:

app1/templates/app3/config.html

app2/templates/app3/config.html

Why it's not working now?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.3905 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO