我只是将项目部署到Heroku,但是找不到模板。有人可以帮我吗
settings.py
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [ os.path.join(BASE_DIR,'Users/jay/Downloads/PJ/ecommerce/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',
],
},
},
]
错误消息:
异常类型:TemplateDoesNotExist
异常值:
list.html
异常位置:get_template,第19行中的/app/.heroku/python/lib/python3.6/site-packages/django/template/loader.py
Python可执行文件:/app/.heroku/python/bin/python
的Python版本:3.6.8
Python路径:
['/app/.heroku/python/bin',
'/ app',
'/app/.heroku/python/lib/python36.zip',
'/app/.heroku/python/lib/python3.6',
'/app/.heroku/python/lib/python3.6/lib-dynload',
'/app/.heroku/python/lib/python3.6/site-packages']
服务器时间:2019年8月22日,星期四09:51:24 +0000
模板加载器事后分析
Django尝试按以下顺序加载这些模板:
使用引擎django: django.template.loaders.filesystem.Loader:/app/Users/jay/Downloads/PJ/ecommerce/templates/list.html(源不存在) django.template.loaders.app_directories.Loader:/app/.heroku/python/lib/python3.6/site-packages/django/contrib/admin/templates/list.html(源不存在) django.template.loaders.app_directories.Loader:/app/.heroku/python/lib/python3.6/site-packages/django/contrib/auth/templates/list.html(源不存在) django.template.loaders.app_directories.Loader:/app/.heroku/python/lib/python3.6/site-packages/crispy_forms/templates/list.html(源不存在) django.template.loaders.app_directories.Loader:/app/accounts/templates/list.html(源不存在) django.template.loaders.app_directories.Loader:/app/carts/templates/list.html(源不存在) django.template.loaders.app_directories.Loader:/app/orders/templates/list.html(源不存在) django.template.loaders.app_directories.Loader:/app/.heroku/python/lib/python3.6/site-packages/bootstrap4/templates/list.html(源不存在)