Hi

I am trying to run loging example from django book:
http://www.djangobook.com/en/2.0/chapter14/

My urls.py is:
from django.conf.urls.defaults import *
from django.contrib.auth.views import login
from django.contrib.auth.views import logout

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()


urlpatterns = patterns('',
     # Example:
     # (r'^security_test/', include('security_test.foo.urls')),

     # Uncomment the admin/doc line below and add 
'django.contrib.admindocs'
     # to INSTALLED_APPS to enable admin documentation:
     # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

     # Uncomment the next line to enable the admin:
     (r'^admin/(.*)', admin.site.root),
     (r'^accounts/login/$',  login),
     (r'^accounts/logout/$', logout),
)

But when I open http://localhost:8000/accounts/login/ I get:

-----------------------------------------
Environment:

Request Method: GET
Request URL: http://localhost:8000/accounts/login/
Django Version: 1.0.2 final
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.sites',
  'security_test.security_panel',
  'django.contrib.admin']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware')

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



Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in 
get_response
   86.                 response = callback(request, *callback_args, 
**callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" 
in _wrapped_view_func
   44.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/auth/views.py" in 
login
   42.     }, context_instance=RequestContext(request))
File "/usr/lib/python2.5/site-packages/django/shortcuts/__init__.py" in 
render_to_response
   18.     return HttpResponse(loader.render_to_string(*args, **kwargs), 
**httpresponse_kwargs)
File "/usr/lib/python2.5/site-packages/django/template/loader.py" in 
render_to_string
   102.         t = get_template(template_name)
File "/usr/lib/python2.5/site-packages/django/template/loader.py" in 
get_template
   80.     source, origin = find_template_source(template_name)
File "/usr/lib/python2.5/site-packages/django/template/loader.py" in 
find_template_source
   73.     raise TemplateDoesNotExist, name

Exception Type: TemplateDoesNotExist at /accounts/login/
Exception Value: registration/login.html

-------------------------
I looks like temoplate loaders are trying to load
/usr/lib/python2.5/site-packages/django/contrib/admin/templates/registration/login.html
instead of
/usr/lib/python2.5/site-packages/django/contrib/auth/tests/templates/registration/login.html
or
/usr/lib/python2.5/site-packages/django/contrib/admin/templates/admin/login.html

Jerzy Orlowski

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

Reply via email to