社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  问与答

请问各位,我在setting里面设置了模板的路径,但是页面显示还是模板文件不存在的错误,何解???急。。。。。。

342013708 • 11 年前 • 7704 次点击  

Environment:

Request Method: GET Request URL: http://127.0.0.1:8000/time/

Django Version: 1.4.2 Python Version: 2.7.0 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware')

Template Loader Error: Django tried loading these templates, in this order: Using loader django.template.loaders.filesystem.Loader: Using loader django.template.loaders.app_directories.Loader: C:\Python27\lib\site-packages\django\contrib\auth\templates\current_datetime.html (File does not exist)

Traceback: File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response 111. response = callback(request, callback_args, *callback_kwargs) File "F:\workspace\mysite\mysite\views.py" in current_datetime 22. t = get_template('current_datetime.html') File "C:\Python27\lib\site-packages\django\template\loader.py" in get_template 145. template, origin = find_template(template_name) File "C:\Python27\lib\site-packages\django\template\loader.py" in find_template 138. raise TemplateDoesNotExist(name)

Exception Type: TemplateDoesNotExist at /time/ Exception Value: current_datetime.html

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/329
文章 [ 5 ]  |  最新文章 11 年前