django-userena の 変更中settings.py
にこのエラーが発生しました
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.3.1
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'easy_thumbnails',
'guardian',
'south',
'userena',
'userena.contrib.umessages',
'demo_project.profiles']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'userena.middleware.UserenaLocaleMiddleware')
Traceback:
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in wrapper
214. return self.admin_view(view, cacheable)(*args, **kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
93. response = view_func(request, *args, **kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
79. response = view_func(request, *args, **kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
196. return self.login(request)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
79. response = view_func(request, *args, **kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in login
331. return login(request, **defaults)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
93. response = view_func(request, *args, **kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
79. response = view_func(request, *args, **kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/contrib/auth/views.py" in login
59. current_site = get_current_site(request)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/contrib/sites/models.py" in get_current_site
92. current_site = Site.objects.get_current()
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/contrib/sites/models.py" in get_current
25. current_site = self.get(pk=sid)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/db/models/manager.py" in get
132. return self.get_query_set().get(*args, **kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/db/models/query.py" in get
349. % self.model._meta.object_name)
Exception Type: DoesNotExist at /admin/
Exception Value: Site matching query does not exist.
このエラーの原因を知っていますか?
編集
ハックハームストンの指示に従うとSite.objects.get(pk=settings.SITE_ID)
、このエラーが返されました
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/db/models/manager.py", line 132, in get
return self.get_query_set().get(*args, **kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/db/models/query.py", line 349, in get
% self.model._meta.object_name)
DoesNotExist: Site matching query does not exist.
>>> Site.objects.get(pk=settings.SITE_ID)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/db/models/manager.py", line 132, in get
return self.get_query_set().get(*args, **kwargs)
File "/home/elie/.django-projects/userena-demo/local/lib/python2.7/site-packages/django/db/models/query.py", line 349, in get
% self.model._meta.object_name)
DoesNotExist: Site matching query does not exist.
私のデータベースにはsite_id http://127.0.0.1:8000/' which is the domain name that i used instead of
example.com`があります