首页 新闻 会员 周边 捐助

django.template.loaders出错

0
悬赏园豆:30 [已关闭问题] 关闭于 2017-08-06 15:54

我曾经将文件夹‘notes’改名为‘my_notes'

导致现在登上网页时错误

Template-loader postmortem

Django tried loading these templates, in this order:

Using engine django:

  • django.template.loaders.filesystem.Loader: /home/pmo/my_note/DIRS/notes/index.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: /home/pmo/my_note/666/lib/python3.5/site-packages/django/contrib/admin/templates/notes/index.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: /home/pmo/my_note/666/lib/python3.5/site-packages/django/contrib/auth/templates/notes/index.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: /home/pmo/my_note/my_notes/templates/notes/index.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: /home/pmo/my_note/users/templates/notes/index.html (Source does not exist)

 

 

我现在需要让django找到/home/pmo/my_note/my_notes/templates/my_notes/index.html 

我试着把settings.py下TEMPLATES的DIRS改动

改成

TEMPLATES = [   

        {

        'BACKEND': 'django.template.backends.django.DjangoTemplates',

        'DIRS': {'DIRS': [os.path.join(BASE_DIR, 'my_notes', 'templates')],},
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

可是没有用,求助谢谢
skrrr的主页 skrrr | 初学一级 | 园豆:110
提问于:2017-08-05 14:27
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册