python django template路径问题windows下

新文 发布于 2017/02/24 17:34
阅读 299
收藏 0

使用pycharm创建的 django 项目,在templates 目录下添加了 index.html 文件,配置了 url 与 view ,在访问的时候报:

OSError at /

[Errno 22] Invalid argument: 'C:\\Users\\xinwen\\PycharmProjects\\blog_pro\\templates\\<function index at 0x03CD2420>'
Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.10.5
Exception Type: OSError
Exception Value:
[Errno 22] Invalid argument: 'C:\\Users\\xinwen\\PycharmProjects\\blog_pro\\templates\\<function index at 0x03CD2420>'
Exception Location: D:\Program Files (x86)\Python35-32\lib\site-packages\django\template\loaders\filesystem.py in get_contents, line 24
Python Executable: D:\Program Files (x86)\Python35-32\python.exe
Python Version: 3.5.2
Python Path:
['C:\\Users\\xinwen\\PycharmProjects\\blog_pro',
 'C:\\Users\\xinwen\\PycharmProjects\\blog_pro',
 'D:\\Program Files (x86)\\Python35-32\\python35.zip',
 'D:\\Program Files (x86)\\Python35-32\\DLLs',
 'D:\\Program Files (x86)\\Python35-32\\lib',
 'D:\\Program Files (x86)\\Python35-32',
 'D:\\Program Files (x86)\\Python35-32\\lib\\site-packages']
Server time: Fri, 24 Feb 2017 17:34:15 +0800
加载中
返回顶部
顶部