I have deployed my project on pythonanywhere and there i am getting an error that template does not exist
It's working properly on local host
File directory
settings.py
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'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',
],
},
},
]
Can someone tell what should i add my template DIRS
Try to put this into DIRS
'DIRS': [os.path.join(BASE_DIR, 'Templates')],
after that you can get your html files like 'Main/test.html'
And yeah it's better to put names in lowercase
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.