Site matching query does not exist.
/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py
, line 47, in inner
response = await sync_to_async(response_for_exception, thread_sensitive=False)(request, exc)
return response
return inner
else:
@wraps(get_response)
def inner(request):
try:
response = get_response(request)…
except Exception as exc:
response = response_for_exception(request, exc)
return response
return inner
DoesNotExist('Site matching query does not exist.')
<bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f4a166462f0>>
<WSGIRequest: GET '/sitemap.xml'>
/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py
, line 181, in _get_response
if response is None:
wrapped_callback = self.make_view_atomic(callback)
# If it is an asynchronous view, run it in a subthread.
if asyncio.iscoroutinefunction(wrapped_callback):
wrapped_callback = async_to_sync(wrapped_callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)…
except Exception as e:
response = self.process_exception_by_middleware(e, request)
if response is None:
raise
# Complain if the view returned None (a common error).
<function sitemap at 0x7f4a108e7400>
()
{'sitemaps': {'Category': <class 'djangoblog.sitemap.CategorySiteMap'>, 'Tag': <class 'djangoblog.sitemap.TagSiteMap'>, 'User': <class 'djangoblog.sitemap.UserSiteMap'>, 'blog': <class 'djangoblog.sitemap.ArticleSiteMap'>, 'static': <class 'djangoblog.sitemap.StaticViewSitemap'>}}
<bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7f4a16368af0>>
<WSGIRequest: GET '/sitemap.xml'>
None
<django.core.handlers.wsgi.WSGIHandler object at 0x7f4a166462f0>
<function sitemap at 0x7f4a108e7400>
/usr/local/lib/python3.10/site-packages/django/contrib/sitemaps/views.py
, line 16, in inner
from django.urls import reverse
from django.utils.http import http_date
def x_robots_tag(func):
@wraps(func)
def inner(request, *args, **kwargs):
response = func(request, *args, **kwargs)…
response.headers['X-Robots-Tag'] = 'noindex, noodp, noarchive'
return response
return inner
@x_robots_tag
()
<function sitemap at 0x7f4a108e7370>
{'sitemaps': {'Category': <class 'djangoblog.sitemap.CategorySiteMap'>, 'Tag': <class 'djangoblog.sitemap.TagSiteMap'>, 'User': <class 'djangoblog.sitemap.UserSiteMap'>, 'blog': <class 'djangoblog.sitemap.ArticleSiteMap'>, 'static': <class 'djangoblog.sitemap.StaticViewSitemap'>}}
<WSGIRequest: GET '/sitemap.xml'>
/usr/local/lib/python3.10/site-packages/django/contrib/sitemaps/views.py
, line 53, in sitemap
@x_robots_tag
def sitemap(request, sitemaps, section=None,
template_name='sitemap.xml', content_type='application/xml'):
req_protocol = request.scheme
req_site = get_current_site(request)…
if section is not None:
if section not in sitemaps:
raise Http404("No sitemap available for section: %r" % section)
maps = [sitemaps[section]]
else:
'application/xml'
'http'
<WSGIRequest: GET '/sitemap.xml'>
None
{'Category': <class 'djangoblog.sitemap.CategorySiteMap'>, 'Tag': <class 'djangoblog.sitemap.TagSiteMap'>, 'User': <class 'djangoblog.sitemap.UserSiteMap'>, 'blog': <class 'djangoblog.sitemap.ArticleSiteMap'>, 'static': <class 'djangoblog.sitemap.StaticViewSitemap'>}
'sitemap.xml'
/usr/local/lib/python3.10/site-packages/django/contrib/sites/shortcuts.py
, line 13, in get_current_site
Check if contrib.sites is installed and return either the current
``Site`` object or a ``RequestSite`` object based on the request.
"""
# Imports are inside the function because its point is to avoid importing
# the Site models when django.contrib.sites isn't installed.
if apps.is_installed('django.contrib.sites'):
from .models import Site
return Site.objects.get_current(request)…
else:
from .requests import RequestSite
return RequestSite(request)
<class 'django.contrib.sites.models.Site'>
<WSGIRequest: GET '/sitemap.xml'>
/usr/local/lib/python3.10/site-packages/django/contrib/sites/models.py
, line 58, in get_current
If SITE_ID isn't defined, return the site with domain matching
request.get_host(). The ``Site`` object is cached the first time it's
retrieved from the database.
"""
from django.conf import settings
if getattr(settings, 'SITE_ID', ''):
site_id = settings.SITE_ID
return self._get_site_by_id(site_id)…
elif request:
return self._get_site_by_request(request)
raise ImproperlyConfigured(
"You're using the Django \"sites framework\" without having "
"set the SITE_ID setting. Create a site in your database and "
<WSGIRequest: GET '/sitemap.xml'>
<django.contrib.sites.models.SiteManager object at 0x7f4a16c7ded0>
<LazySettings "djangoblog.settings">
1
/usr/local/lib/python3.10/site-packages/django/contrib/sites/models.py
, line 30, in _get_site_by_id
class SiteManager(models.Manager):
use_in_migrations = True
def _get_site_by_id(self, site_id):
if site_id not in SITE_CACHE:
site = self.get(pk=site_id)…
SITE_CACHE[site_id] = site
return SITE_CACHE[site_id]
def _get_site_by_request(self, request):
host = request.get_host()
try:
<django.contrib.sites.models.SiteManager object at 0x7f4a16c7ded0>
1
/usr/local/lib/python3.10/site-packages/django/db/models/manager.py
, line 85, in manager_method
def check(self, **kwargs):
return []
@classmethod
def _get_queryset_methods(cls, queryset_class):
def create_method(name, method):
def manager_method(self, *args, **kwargs):
return getattr(self.get_queryset(), name)(*args, **kwargs)…
manager_method.__name__ = method.__name__
manager_method.__doc__ = method.__doc__
return manager_method
new_methods = {}
for name, method in inspect.getmembers(queryset_class, predicate=inspect.isfunction):
()
{'pk': 1}
'get'
<django.contrib.sites.models.SiteManager object at 0x7f4a16c7ded0>
/usr/local/lib/python3.10/site-packages/django/db/models/query.py
, line 435, in get
if not clone.query.select_for_update or connections[clone.db].features.supports_select_for_update_with_limit:
limit = MAX_GET_RESULTS
clone.query.set_limits(high=limit)
num = len(clone)
if num == 1:
return clone._result_cache[0]
if not num:
raise self.model.DoesNotExist(…
"%s matching query does not exist." %
self.model._meta.object_name
)
raise self.model.MultipleObjectsReturned(
'get() returned more than one %s -- it returned %s!' % (
self.model._meta.object_name,
()
<QuerySet []>
{'pk': 1}
21
0
<QuerySet [<Site: foolcat.cn>]>
AnonymousUser
No GET data
No POST data
No FILES data
No cookie data
'*/*'
'deflate, gzip'
'close'
'www.foolcat.cn'
'Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)'
'154.218.129.214, 172.21.0.1'
'true'
'172.21.0.1'
'/sitemap.xml'
''
'/sitemap.xml'
'172.21.0.2'
'60906'
'GET'
''
'0.0.0.0'
'8000'
'HTTP/1.0'
'gunicorn/20.1.0'
<gevent._socket3.socket at 0x7f4a12a8c280 object, fd=12, family=2, type=1, proto=6>
<gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f4a12a0f7f0>
<class 'gunicorn.http.wsgi.FileWrapper'>
<gunicorn.http.body.Body object at 0x7f4a12a0fc10>
True
False
True
False
'http'
(1, 0)
djangoblog.settings
{}
[('admin', 'admin@admin.com')]
['*', '127.0.0.1', 'example.com']
True
['accounts.user_login_backend.EmailOrUsernameModelBackend']
'********************'
'accounts.BlogUser'
'http://data.zz.baidu.com/urls?site=https://www.lylinux.net&token=1uAOGrMsUm5syDGn'
'/code/djangoblog'
['default', 'primary', 'success', 'info', 'warning', 'danger']
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 'LOCATION': 'unique-snowflake', 'TIMEOUT': 10800}}
2592000
'default'
'********************'
600
{'css': 'compressor.css.CssCompressor', 'js': 'compressor.js.JsCompressor'}
()
'default'
'********************'
''
'cleancss'
''
'java -jar compiler.jar'
['compressor.filters.css_default.CssAbsoluteFilter', 'compressor.filters.cssmin.CSSMinFilter']
'mtime'
1024
None
True
{'css': ['compressor.filters.css_default.CssAbsoluteFilter', 'compressor.filters.cssmin.rCSSMinFilter'], 'js': ['compressor.filters.jsmin.rJSMinFilter']}
<function CompressorConf.JINJA2_GET_ENVIRONMENT at 0x7f4a16629a20>
['compressor.filters.jsmin.JSMinFilter']
30
10
False
{'STATIC_URL': '/static/'}
'manifest.json'
31536000
'CACHE'
'compressor.parser.AutoSelectParser'
()
2592000
'/code/djangoblog/collectedstatic'
'compressor.storage.CompressorFileStorage'
{'STATIC_URL': '/static/'}
'/static/'
'/__compressor_url_placeholder__/'
False
'yuglify'
'--terminal'
'--terminal'
'java -jar yuicompressor.jar'
''
''
31449600
None
False
'csrftoken'
'/'
'Lax'
False
'django.views.csrf.csrf_failure'
'HTTP_X_CSRFTOKEN'
[]
False
{'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.mysql', 'HOST': 'db', 'NAME': 'djangoblog', 'OPTIONS': {'charset': 'utf8mb4'}, 'PASSWORD': '********************', 'PORT': 3306, 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'root'}}
[]
2621440
1000
'N j, Y, P'
['%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M']
'N j, Y'
['%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y']
'%Y-%m-%d'
True
False
'.'
'django.db.models.BigAutoField'
'utf-8'
'django.views.debug.ExceptionReporter'
'django.views.debug.SafeExceptionReporterFilter'
'django.core.files.storage.FileSystemStorage'
None
'sha256'
''
''
[]
'django.core.mail.backends.smtp.EmailBackend'
'smtp.mxhichina.com'
'********************'
None
465
None
'********************'
'[Django] '
None
False
True
False
None
['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler']
2621440
420
None
0
[]
None
None
'django.forms.renderers.DjangoTemplates'
{'default': {'ENGINE': 'djangoblog.whoosh_cn_backend.WhooshEngine', 'PATH': '/code/djangoblog/djangoblog/whoosh_index'}}
'haystack.signals.RealtimeSignalProcessor'
[]
['django.contrib.admin.apps.SimpleAdminConfig', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'django.contrib.sitemaps', 'mdeditor', 'haystack', 'blog', 'accounts', 'comments', 'oauth', 'servermanager', 'owntracks', 'compressor']
[]
[('af', 'Afrikaans'), ('ar', 'Arabic'), ('ar-dz', 'Algerian Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('hy', 'Armenian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('ig', 'Igbo'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('ky', 'Kyrgyz'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokmål'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'), ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('sw', 'Swahili'), ('ta', 'Tamil'), ('te', 'Telugu'), ('tg', 'Tajik'), ('th', 'Thai'), ('tk', 'Turkmen'), ('tr', 'Turkish'), ('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('uz', 'Uzbek'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')]
['he', 'ar', 'ar-dz', 'fa', 'ur']
'zh-hans'
None
None
False
'django_language'
'/'
None
False
[]
{'disable_existing_loggers': False, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}, 'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'}}, 'formatters': {'verbose': {'format': '[%(asctime)s] %(levelname)s ' '[%(name)s.%(funcName)s:%(lineno)d ' '%(module)s] %(message)s'}}, 'handlers': {'console': {'class': 'logging.StreamHandler', 'filters': ['require_debug_true'], 'formatter': 'verbose', 'level': 'DEBUG'}, 'log_file': {'class': 'logging.handlers.RotatingFileHandler', 'filename': 'djangoblog.log', 'formatter': 'verbose', 'level': 'INFO', 'maxBytes': 16777216}, 'mail_admins': {'class': 'django.utils.log.AdminEmailHandler', 'filters': ['require_debug_false'], 'level': 'ERROR'}, 'null': {'class': 'logging.NullHandler'}}, 'loggers': {'django.request': {'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': False}, 'djangoblog': {'handlers': ['log_file', 'console'], 'level': 'INFO', 'propagate': True}}, 'root': {'handlers': ['console', 'log_file'], 'level': 'INFO'}, 'version': 1}
'logging.config.dictConfig'
'/accounts/profile/'
'/login/'
None
[]
'/code/djangoblog/uploads'
'/media/'
'django.contrib.messages.storage.fallback.FallbackStorage'
['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.gzip.GZipMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.http.ConditionalGetMiddleware', 'blog.middleware.OnlineMiddleware']
{}
'F j'
0
10
'********************'
'********************'
'********************'
False
'djangoblog.urls'
'********************'
False
True
False
False
0
None
[]
'same-origin'
None
False
None
'default'
1209600
None
True
'sessionid'
'/'
'Lax'
False
'django.contrib.sessions.backends.db'
False
None
False
'django.contrib.sessions.serializers.JSONSerializer'
'djangoblog.settings'
'm/d/Y P'
'm/d/Y'
'django.core.signing.TimestampSigner'
[]
1
'/code/djangoblog/static'
[]
('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder')
'django.contrib.staticfiles.storage.StaticFilesStorage'
'/code/djangoblog/collectedstatic'
'/static/'
[{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/code/djangoblog/templates'], 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'blog.context_processors.seo_processor']}}]
False
[]
'django.test.runner.DiscoverRunner'
','
'%Y-%m-%d %H:%M:%S'
['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
'Asia/Shanghai'
True
True
False
True
False
False
'djangoblog.wsgi.application'
'995F03AC401D6CABABAEF756FC4D43C7'
'SAMEORIGIN'
'F Y'
You’re seeing this error because you have DEBUG = True
in your
Django settings file. Change that to False
, and Django will
display a standard page generated by the handler for this status code.