Je ne parviens pas à accéder à l'interface d'administration dans django 1.1.1 en utilisant localloop:8000/admin
. Il fonctionnait bien sur Ubuntu 8.4 puis j'ai mis à niveau vers Ubuntu 10.10 et le problème est survenu.TemplateDoesNotExist at/admin/admin/index.html
Dans settings.py
J'ai:
import os.path
PROJECT_DIR=os.path.dirname(__file__)
TEMPLATE_DIRS =(os.path.join(PROJECT_DIR,'templates'))
Cela fonctionnait très bien sur Ubuntu 8.04, mais pas dans Ubuntu 10.10.
Des idées sur ce qui ne va pas? Voici le retraçage:
Environment:
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.1.1
Python Version: 2.6.6
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'hotweb.accounts',
'django.contrib.flatpages',
'messages',
'hotweb.jchat']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
'django.middleware.http.SetRemoteAddrFromForwardedFor')
Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.load_template_source:
/home/scorpion/Desktop/hotweb/templates/admin/index.html (File does not exist)
Using loader django.template.loaders.app_directories.load_template_source:
/usr/local/lib/python2.6/dist-packages/django/contrib/admin/templates/admin/index.html (File exists)
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
92. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in wrapper
196. return self.admin_view(view, cacheable)(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
44. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in inner
186. return view(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
44. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in index
374. context_instance=context_instance
File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/__init__.py" in render_to_response
20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in render_to_string
103. t = get_template(template_name)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in get_template
81. source, origin = find_template_source(template_name)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in find_template_source
74. raise TemplateDoesNotExist, name
Exception Type: TemplateDoesNotExist at /admin/
Exception Value: admin/index.html
ici est le retraçage
Environment:
Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.1.1
Python Version: 2.6.6
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'hotweb.accounts',
'django.contrib.flatpages',
'messages',
'hotweb.jchat']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
'django.middleware.http.SetRemoteAddrFromForwardedFor')
Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.load_template_source:
/home/scorpion/Desktop/hotweb/templates/admin/index.html (File does not exist)
Using loader django.template.loaders.app_directories.load_template_source:
/usr/local/lib/python2.6/dist-packages/django/contrib/admin/templates/admin/index.html (File exists)
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
92. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in wrapper
196. return self.admin_view(view, cacheable)(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
44. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in inner
186. return view(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
44. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in index
374. context_instance=context_instance
File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/__init__.py" in render_to_response
20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in render_to_string
103. t = get_template(template_name)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in get_template
81. source, origin = find_template_source(template_name)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in find_template_source
74. raise TemplateDoesNotExist, name
Exception Type: TemplateDoesNotExist at /admin/
Exception Value: admin/index.html
C'est un peu un chemin étrange et/ou URL: «/admin/admin/index.html », car il a un espace et l'administrateur est répété. Est-ce que * quoi que ce soit * d'autre a changé en plus d'aller de 8.04 à 10.10? Python différent? Différent Django? –
noo rien que la plate-forme est changée de 8.04 à 10.10 – MajorGeek