您的位置:首页 > 编程语言 > Go语言

django 1.11 报表:django.template.exceptions.TemplateDoesNotExist:

2017-08-24 15:59 423 查看
解决方法:

在settings.py 中TEMPLATES 参数 dirs加入设置:os.path.join(BASE_DIR, ‘templates’).replace(‘\’, ‘/’)

TEMPLATES = [

{

‘BACKEND’: ‘django.template.backends.django.DjangoTemplates’,

‘DIRS’: [os.path.join(BASE_DIR, ‘templates’).replace(‘\’, ‘/’)],

‘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’,

],

},

},

]

注意:windows 必须加上replace(‘\’, ‘/’)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  django templates