Hi,

I'm a Django newbie and have run into a Template Not Found error when
setting up the admin interface on a site I'm building.

Here's the error:
----------------------------------------------------------------------------------

Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.1
Python Version: 2.6.2
Installed Applications:
['django.contrib.admindocs',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.flatpages',
 'django.contrib.humanize',
 'django.contrib.redirects',
 'django.contrib.sessions',
 'django.contrib.sites']
Installed Middleware:
('django.middleware.transaction.TransactionMiddleware',
 'django.middleware.gzip.GZipMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.csrf.middleware.CsrfMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
 'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
 'django.middleware.http.ConditionalGetMiddleware')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.load_template_source:
/home/jeff/projects/osl/oslaurier/templates/admin/login.html (File
does not exist)
Using loader
django.template.loaders.app_directories.load_template_source:
/usr/lib/python2.6/site-packages/django/contrib/admindocs/templates/
admin/login.html (File does not exist)



Traceback:
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py"
in get_response
  92.                 response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/sites.py"
in wrapper
  196.                 return self.admin_view(view, cacheable)(*args,
**kwargs)
File "/usr/lib/python2.6/site-packages/django/views/decorators/
cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/sites.py"
in inner
  185.                 return self.login(request)
File "/usr/lib/python2.6/site-packages/django/views/decorators/
cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/sites.py"
in login
  288.             return self.display_login_form(request, message)
File "/usr/lib/python2.6/site-packages/django/contrib/admin/sites.py"
in display_login_form
  389.             context_instance=context_instance
File "/usr/lib/python2.6/site-packages/django/shortcuts/__init__.py"
in render_to_response
  20.     return HttpResponse(loader.render_to_string(*args,
**kwargs), **httpresponse_kwargs)
File "/usr/lib/python2.6/site-packages/django/template/loader.py" in
render_to_string
  103.         t = get_template(template_name)
File "/usr/lib/python2.6/site-packages/django/template/loader.py" in
get_template
  81.     source, origin = find_template_source(template_name)
File "/usr/lib/python2.6/site-packages/django/template/loader.py" in
find_template_source
  74.     raise TemplateDoesNotExist, name

Exception Type: TemplateDoesNotExist at /admin/
Exception Value: admin/login.html

---------------------------------------------------------------------------------------------------------

Here's my project's urlconf:

# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^admin/', include(admin.site.urls)),
    (r'^articles/', include('oslaurier.articles.urls')),
)

------------------------------------------------------------------------------------------------------

I noticed that for some reason Django is looking in the admindocs'
template directory rather than the admin's template directory (i.e. it
is looking in /usr/lib/python2.6/site-packages/django/contrib/
admindocs/templates/admin/login.html and not /usr/lib/python2.6/site-
packages/django/contrib/admin/templates/admin/login.html). I've tried
commenting out admindocs in both installed apps and the urlconf and
restarting the server but I get the same error (except it just gives
no location for using the app loader directory instead of the
admindocs path).

Any help you can provide me would be greatly appreciated.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to