[GH-ISSUE #408] Error 500 on /login : Does not exist #308

Closed
opened 2026-02-27 16:38:48 +03:00 by kerem · 2 comments
Owner

Originally created by @stephen304 on GitHub (Aug 30, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/408

Installed KVM and libvirt, and django and webvirtmgr, nginx and supervisor like the tutorial says but it gives me 500 internal server error when I try to load the page. I'm probably doing something obviously wrong but I don't see what...

Stack trace:

Environment:


Request Method: GET
Request URL: http://openstack:1337/login/

Django Version: 1.5.5
Python Version: 2.7.6
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'webvirtmgr',
 'servers',
 'instance',
 'create',
 'gunicorn')
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')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  115.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper
  75.             return view(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/views.py" in login
  57.     current_site = get_current_site(request)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/sites/models.py" in get_current_site
  95.         current_site = Site.objects.get_current()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/sites/models.py" in get_current
  26.             current_site = self.get(pk=sid)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py" in get
  143.         return self.get_query_set().get(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in get
  404.                 self.model._meta.object_name)

Exception Type: DoesNotExist at /login/
Exception Value: Site matching query does not exist.
Originally created by @stephen304 on GitHub (Aug 30, 2014). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/408 Installed KVM and libvirt, and django and webvirtmgr, nginx and supervisor like the tutorial says but it gives me 500 internal server error when I try to load the page. I'm probably doing something obviously wrong but I don't see what... Stack trace: ``` Environment: Request Method: GET Request URL: http://openstack:1337/login/ Django Version: 1.5.5 Python Version: 2.7.6 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'webvirtmgr', 'servers', 'instance', 'create', 'gunicorn') 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') Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 115. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper 75. return view(request, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view 91. response = view_func(request, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func 89. response = view_func(request, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/views.py" in login 57. current_site = get_current_site(request) File "/usr/local/lib/python2.7/dist-packages/django/contrib/sites/models.py" in get_current_site 95. current_site = Site.objects.get_current() File "/usr/local/lib/python2.7/dist-packages/django/contrib/sites/models.py" in get_current 26. current_site = self.get(pk=sid) File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py" in get 143. return self.get_query_set().get(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in get 404. self.model._meta.object_name) Exception Type: DoesNotExist at /login/ Exception Value: Site matching query does not exist. ```
kerem closed this issue 2026-02-27 16:38:48 +03:00
Author
Owner

@stephen304 commented on GitHub (Aug 30, 2014):

I followed instructions from stackoverflow and it seems to have fixed it:

sudo ./manage.py shell
>>> from django.contrib.sites.models import Site
>>> Site.objects.create(name='example.com', domain='example.com')

I'll test it out a bit and make sure it worked.
Edit: That totally worked.

<!-- gh-comment-id:53972440 --> @stephen304 commented on GitHub (Aug 30, 2014): I followed instructions from stackoverflow and it seems to have fixed it: ``` sudo ./manage.py shell >>> from django.contrib.sites.models import Site >>> Site.objects.create(name='example.com', domain='example.com') ``` I'll test it out a bit and make sure it worked. Edit: That totally worked.
Author
Owner

@generalmanager commented on GitHub (Sep 14, 2014):

I just encountered the same error, thanks a lot!

<!-- gh-comment-id:55524917 --> @generalmanager commented on GitHub (Sep 14, 2014): I just encountered the same error, thanks a lot!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#308
No description provided.