最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

django - Template does not exists error in python anywhere - Stack Overflow

programmeradmin4浏览0评论

I have deployed my django app in python anywhere and getting below error :

TemplateDoesNotExist at /topic/
cms_app\content.html

I have two apps in my project. One is cms_app and other is users.

My templates location is Content_Mgmnt/cms_app/templates
/cms_app/content.html

For users and other cms_app templates are working fine however for /topic/ url this is not working and showing templates does not exists.

The same code is working fine in development environment however giving issues in production. How to solve this error?

I have deployed my django app in python anywhere and getting below error :

TemplateDoesNotExist at /topic/
cms_app\content.html

I have two apps in my project. One is cms_app and other is users.

My templates location is Content_Mgmnt/cms_app/templates
/cms_app/content.html

For users and other cms_app templates are working fine however for /topic/ url this is not working and showing templates does not exists.

The same code is working fine in development environment however giving issues in production. How to solve this error?

Share Improve this question asked Mar 17 at 17:05 MithelMithel 18511 bronze badges 4
  • Is Content_Mgmnt the name of your project? – dev_light Commented Mar 17 at 18:54
  • Also include the complete error message and show us the content of content.html – dev_light Commented Mar 17 at 18:54
  • Sure I will do that from next time. I have resolved this issue. Changing the slash from cms_app\content.html to cms_app/content.html resolved the issue. – Mithel Commented Mar 18 at 2:59
  • 1 @Mithel could you edit the OP with some clarification that the issue was related to a typo and mark it as resolved? – caseneuve Commented Mar 18 at 9:20
Add a comment  | 

1 Answer 1

Reset to default 0

I was getting this error for template does not exists which I resolved.

Error during template rendering

In template /home/Django_Content_Mgmnt_App/cms_app/templates/cms_app/topic_list.html, error at line 1

cms_app\content.html

{% extends 'cms_app\content.html' %}

I checked the template where error occurred from the files tab in Python Anywhere and compared this with other templates which were working fine to find the issue. It was a typo error, so I have changed this code from {% extends 'cms_app\content.html' %} to {% extends 'cms_app/content.html' %}. And reloaded my code and it's now working.

发布评论

评论列表(0)

  1. 暂无评论