我的django应用程序的结构如下所示home/damon/dev/me/myproject/
manage.py
/mytracker/
__init__.py
settings.py
urls.py
/monitor/
/media/
/mymonitor/
__init__.py
models.py
views.py
urls.py
/templates/
base.html
home.html
在.bashrc中,我将PYTHONPATH设置为/home/damon/dev/me/myproject/
在设置.py为媒体根目录和模板目录添加了这些值
^{pr2}$
在mytracker.url.py有url(r'',include('mymonitor.urls')),
url(r'^site_media/(?P.*)$','django.views.static.serve',{'document_root':settings.MEDIA_ROOT}),
鉴于mymonitor.url.py有...
url(r'^$','mymonitor.views.home',
{'template_name':'home.html',
'page_title':'Home'
},
name='home'),
..
在基本.html扩展了主页.html在{% extends "base.html" %}
{% block content %}
Your Home
{% endblock %}
我认为pythonpath,文件的位置,一切都是正确的…但是我仍然得到一个templatedoesnotex错误Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.4
Exception Type: TemplateDoesNotExist
Exception Value:
[{'page_title': 'Home'}, {'csrf_token':
在视图.py有def custom_render(request,context,template):
req = RequestContext(request,context)
return render_to_response(req)
def home(request,template_name,page_title):
context = {'page_title':page_title}
return custom_render(request,context,template_name)
我不明白为什么会这样发生了。怎么做我要诊断这个错误吗。。?有人能告诉我吗?在