Django中的模板错误

Django中的模板错误,django,django-templates,django-views,Django,Django Templates,Django Views,如屏幕截图所示,在我的博客文件夹中有accounts文件夹 然后,我从主页转到帐户文件夹中我的登录页的下一页 我得到以下错误 有人能帮帮我吗 这是settings.py文件 “”“ 控制台输出错误: Internal Server Error: /accounts/signin.html/ Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers

如屏幕截图所示,在我的博客文件夹中有accounts文件夹

然后,我从主页转到帐户文件夹中我的登录页的下一页

我得到以下错误

有人能帮帮我吗

这是settings.py文件

“”“

控制台输出错误:

Internal Server Error: /accounts/signin.html/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/usman/Django Project/django-black/luckdrum/blog/views.py", line 27, in login
    return render_to_response('accounts/signin.html')
  File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py", line 39, in render_to_response
    content = loader.render_to_string(template_name, context, using=using)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 96, in render_to_string
    template = get_template(template_name, using=using)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 43, in get_template
    raise TemplateDoesNotExist(template_name, chain=chain)
TemplateDoesNotExist: accounts/signin.html
[13/Dec/2015 07:06:07] "GET /accounts/signin.html/ HTTP/1.1" 500 75747

将模板文件从accounts文件夹移动到template文件夹,并将静态文件移动到相应的静态文件夹。Django仅在名为templates的文件夹中查找模板文件


同时将原始的
render_to_response
更改为
render_to_response('sign.html')

添加错误文本和您的设置。py我没有看到错误。您发布了堆栈跟踪的一部分。请发布文本而不是图像。您的html文件应位于名为templates的文件夹中。帐户不起作用。我已在settings.py中添加了以下行。这是否也起作用?TEMPLATE\u DIRS=(“/home/usman/Django-Project/Django-black/luckdrum/blog/accounts/”,将原来的
render\u-to-u-response
更改为
render\u-to-u-response('signin.html')
,因为我已经添加了模板目录并添加了render\u-to-u-response('sign.html'))它仍然显示找不到相同的错误模板。我是否继续?错误页面必须向您显示它尝试的目录列表?您可以共享该列表吗?它给了我相同的旧错误,因为我的模板不存在。
Internal Server Error: /accounts/signin.html/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/usman/Django Project/django-black/luckdrum/blog/views.py", line 27, in login
    return render_to_response('accounts/signin.html')
  File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py", line 39, in render_to_response
    content = loader.render_to_string(template_name, context, using=using)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 96, in render_to_string
    template = get_template(template_name, using=using)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 43, in get_template
    raise TemplateDoesNotExist(template_name, chain=chain)
TemplateDoesNotExist: accounts/signin.html
[13/Dec/2015 07:06:07] "GET /accounts/signin.html/ HTTP/1.1" 500 75747