Hi Django Users,

I developed web application using Django. When I run my django web
application on development server (python manage.py runserver)
everything was fine. Then I tried to use Apache and mod_python to run
my web application. I already configured httpd.conf like this:

<Location "/hermis/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE hermis.settings
    PythonOption django.root /hermis
    PythonDebug On
    PythonPath "['/home/jimmy/django_projects/hermis', '/home/jimmy/
django_projects', '/var/www'] + sys.path"
</Location>
<location "/media">
    SetHandler None
</Location>
<Location "/media/admin">
    SetHandler None
</Location>

This is my urls.py for admin:
(r'^admin/', include(admin.site.urls)),

my django project is in:
"/home/jimmy/django_projects"

my application is in:
"/home/jimmy/django_projects/hermis"

It worked fine but when I tried to load up django administration page
it showed error like this:

Environment:

Request Method: GET
Request URL: http://192.168.16.151/hermis/admin/
Django Version: 1.2.5
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'mycalendar',
 'django.contrib.admin']
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/jimmy/django_projects/hermis/templates/admin/login.html (File
exists)
Using loader django.template.loaders.app_directories.Loader:
/usr/lib/python2.6/django/contrib/admin/templates/admin/login.html
(File exists)



Traceback:
File "/usr/lib/python2.6/django/core/handlers/base.py" in get_response
  100.                     response = callback(request,
*callback_args, **callback_kwargs)
File "/usr/lib/python2.6/django/contrib/admin/sites.py" in wrapper
  207.                 return self.admin_view(view, cacheable)(*args,
**kwargs)
File "/usr/lib/python2.6/django/utils/decorators.py" in _wrapped_view
  76.                     response = view_func(request, *args,
**kwargs)
File "/usr/lib/python2.6/django/views/decorators/cache.py" in
_wrapped_view_func
  78.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/django/contrib/admin/sites.py" in inner
  189.                 return self.login(request)
File "/usr/lib/python2.6/django/views/decorators/cache.py" in
_wrapped_view_func
  78.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/django/contrib/admin/sites.py" in login
  310.             return self.display_login_form(request, message)
File "/usr/lib/python2.6/django/contrib/admin/sites.py" in
display_login_form
  409.             context_instance=context_instance
File "/usr/lib/python2.6/django/shortcuts/__init__.py" in
render_to_response
  20.     return HttpResponse(loader.render_to_string(*args,
**kwargs), **httpresponse_kwargs)
File "/usr/lib/python2.6/django/template/loader.py" in
render_to_string
  181.         t = get_template(template_name)
File "/usr/lib/python2.6/django/template/loader.py" in get_template
  157.     template, origin = find_template(template_name)
File "/usr/lib/python2.6/django/template/loader.py" in find_template
  138.     raise TemplateDoesNotExist(name)

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

Does anyone know how to solve this problem?

-- 
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