1

Every time i try to access the admin page i get this error and this is the Traceback

Environment:

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

Django Version: 1.3.1
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs']
 Installed Middleware:
 ('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/home/ajmi/spam/templates/admin/login.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin/login.html           (File exists)
/usr/local/lib/python2.7/dist-   packages/django/contrib/admindocs/templates/admin/login.html (File does not exist)
Using loader django.template.loaders.eggs.Loader:

The login.html File does not exist, how to fix this. Thank you

4
  • 1
    I note that the traceback says that the file does exist in the app_directories loader. Is it maybe not readable or something similar? This is definitely an odd problem. Nov 22, 2011 at 17:02
  • 2
    Yes, as @LukeSneeringer points out, look at your file system permissions. That means, see if you can actually open and read /usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin/login.html with the same user permissions that you're running your test server with.
    – benjaoming
    Nov 22, 2011 at 19:06
  • Thank you guys, i changed the permission to root user by typing: sudo python manage.py runserver. and it works very well
    – Ahmad Ajmi
    Nov 22, 2011 at 19:20
  • See my answer here if still not fixed for some of yours. stackoverflow.com/a/32358905/303681
    – mmrs151
    Sep 2, 2015 at 16:55

1 Answer 1

0

Thank you guys, i changed the permission to root user by typing:

sudo python manage.py runserver. 

and it works very well

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.