Problem with Django TemplateDoesNotExist.

304 views
Skip to first unread message

jamesmarcusdavy7

unread,
Nov 18, 2017, 12:57:22 PM11/18/17
to Django users
Hello, am using django 1.11.7 with python 2.7.13.But i have a problem when trying to load my page,the page gives me this error

TemplateDoesNotExist at /

base.html
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.11.7
Exception Type: TemplateDoesNotExist
Exception Value:
base.html
Exception Location: C:\Users\JEMO.JAMES\Desktop\marcus\lib\site-packages\django\template\loader.py in get_template, line 25
Python Executable: C:\Users\JEMO.JAMES\Desktop\marcus\Scripts\python.exe
Python Version: 2.7.13
Python Path:
['C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\src',
 'C:\\Windows\\SYSTEM32\\python27.zip',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\DLLs',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\plat-win',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\lib-tk',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\Scripts',
 'c:\\python27\\Lib',
 'c:\\python27\\DLLs',
 'c:\\python27\\Lib\\lib-tk',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus',
 'C:\\Users\\JEMO.JAMES\\Desktop\\marcus\\lib\\site-packages']
Server time: Sat, 18 Nov 2017 17:18:25 +0000
My template folder is at the same place my manage.py is and in the base.py I have specified the Templates DIRS as DIRS:[os.path.join(BASE_DIR,'templates)].How can i  solve this problem?

Amitesh Sahay

unread,
Nov 18, 2017, 1:51:31 PM11/18/17
to jamesmar...@gmail.com, Django users
Hi,

1) Its pretty obvious that the django is not able to find the required file in the given file path, so please it. 

2) As far as I know, the django 1.11 is supported by Python 3.6. So,  I would recommend you to go through the release notes of the 1.11 and use the recommended system configuration, otherwise if you put the code in prod env things may go hey-wire. For your confirmation, please take 2nd opinion on this part before you take any decision. 


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/74dbc9f0-877c-44d5-aff4-800843c11a29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Dewhirst

unread,
Nov 18, 2017, 11:14:02 PM11/18/17
to django...@googlegroups.com
You could try and convert the Windows pathnames from backslashes to
forward slashes.

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

My own Windows equivalent is ...

TEMPLATES = [ { 'BACKEND':
'django.template.backends.django.DjangoTemplates', 'DIRS': [
os.path.join(APPS_ROOT, '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.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages', ], }, }, ]



>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/d/msgid/django-users/74dbc9f0-877c-44d5-aff4-800843c11a29%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages