localloop:8000/admin
を使用してdjango 1.1.1の管理インターフェースにアクセスできません。 Ubuntu 8.4でうまくいき、Ubuntu 10.10にアップグレードして問題が発生しました。 settings.py
でTemplateDoesNotExist/admin/admin/index.html
私が持っている:
import os.path
PROJECT_DIR=os.path.dirname(__file__)
TEMPLATE_DIRS =(os.path.join(PROJECT_DIR,'templates'))
これはUbuntuの10.10でのUbuntu 8.04上で正常に動作しなかったが。
何が問題になるかについてのアイデアはありますか?ここでトレースバックがある:TEMPLATE_DIRS
設定は、管理者のアプリとは何の関係もありませんので、ここで
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
トレースバック
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
に
True
に設定されていることを確認します。それはそれでスペースを持っているので、「/管理者/管理者/ index.htmlを」と、管理者があります繰り返される。 8.04から10.10へと変わったこと以外は何か変わったのですか?異なるPython?別のDjango? –nooプラットフォームだけが8.04から10.10に変更されました – MajorGeek