Templatedoesnotexist At /hobbies/ (solved)
This question is the sequel of my previous question - Reverse for 'hobbieswithCSS.html' not found. 'hobbieswithCSS.html' is not a valid view function or pattern name I have moved f
Solution 1:
these will solve it for sure.
1.if your saved your templates in a separate templates by app name in templates directory you have to put the name of the sub-folder before the name of the template like this hobbies/hobbieswithCSS.html
.
2. set the root of the template directory in your settings.py
for project and templates.
BASE_DIR = Path(__file__).resolve().parent.parent
TEMPLATE_DIRS = (
os.path.join(SETTINGS_PATH, 'templates'),
)
also check this out Django TemplateDoesNotExist?
Solution 2:
Change your views.py
like this:
defhobbieswithCSS(request):
return render(request,'basic_app/hobbieswithCSS.html')
Post a Comment for "Templatedoesnotexist At /hobbies/ (solved)"