plz help i found this kinda problem when i run

30 vues
Accéder directement au premier message non lu

ALAKO ABIYO

non lue,
27 août 2020, 11:02:0427/08/2020
à Django users

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/time/

Django Version: 1.8
Python Version: 2.7.17
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/home/django/mysite/templates/current_datetime.html (File does not exist)
/home/html/example.com/current_datetime.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/home/aa/.local/lib/python2.7/site-packages/django/contrib/admin/templates/current_datetime.html (File does not exist)
/home/aa/.local/lib/python2.7/site-packages/django/contrib/auth/templates/current_datetime.html (File does not exist)



Traceback:
File "/home/aa/.local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/aa/mysite/mysite/views.py" in current_datetime
  12.     t=get_template('current_datetime.html')
File "/home/aa/.local/lib/python2.7/site-packages/django/template/loader.py" in get_template
  46.     raise TemplateDoesNotExist(template_name)

Exception Type: TemplateDoesNotExist at /time/
Exception Value: current_datetime.html

Ogunsanya Opeyemi

non lue,
27 août 2020, 12:34:4627/08/2020
à django...@googlegroups.com
This means that your current_datetime.html template does not exists in any of those directory in the defined directory under templates in your setting.py file.



--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/898d34f9-b67c-40aa-9dc9-32fab2e5f50cn%40googlegroups.com.

RANGA BHARATH JINKA

non lue,
28 août 2020, 03:37:2028/08/2020
à django...@googlegroups.com
Hi,

    Create a templates folder in your base directory where manage.py exists. Change the templates folder path in settings.py as 'DIRS': [os.path.join(BASE_DIR,'templates')]

All the best




--
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

sapna Choudhary

non lue,
31 août 2020, 07:57:1331/08/2020
à django...@googlegroups.com
You need to create a directory named templates in your current directory i.e., any app or project directory under that templates directory create html file and include that html file with render method.


Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message