首页 > Django:按照tutorial 安装django-polls 时找不到templates

Django:按照tutorial 安装django-polls 时找不到templates

初学者一枚,根据djangoproject官方文档tutorial学习,在“Advanced tutorial: How to write reusable apps”这一章节遇到了问题——

按照指导安装django-polls到mysite

pip --user install /Users/john/django-polls/dist/django-polls-0.1.tar.gz

成功后运行server

python manage.py runserver

浏览器输入127.0.0.1:8000/polls/ 后返回错误:

#mysite的setting.py中TEMPLATE如下:
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, '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',
            ],
        },
    },
]

在各种地方都搜素了没有找到答案。刚刚初学,还望大家给指点。


模板文件不存在,新建模板文件即可。


你这个目录不对 或者是目录下没有对应模版文件


模板文件不存在
我也在学django,楼主你QQ多少,我们可以交流下

【热门文章】
【热门文章】