Closed ghost closed 11 years ago
Hi,
in which sitemap does the problem occurs ?
Do you have entries published ?
blog sitemap works but when i followed the docs getting started setting up sitemap for the site i got an error when i check sitemap.xml. the posts are published but im working offline with no internet access.
I have the full error description here.
The blog works fine no issues whatsoever with it, the blog sitemap works also.
I use $ django-admin.py startproject --template=https://github.com/pinax/pinax-project-account/zipball/master
ValueError at /sitemap.xml
max() arg is an empty sequence
Request Method: GET Request URL: http://127.0.0.1:8000/sitemap.xml Django Version: 1.4.2 Exception Type: ValueError Exception Value:
max() arg is an empty sequence
Exception Location: /home/samuel/Documents/Virtual/1.4/django2/local/lib/python2.7/site-packages/django_blog_zinnia-0.12.dev-py2.7.egg/zinnia/sitemaps.py in set_max_entries, line 74 Python Executable: /home/samuel/Documents/Virtual/1.4/django2/bin/python Python Version: 2.7.3
Environment:
Request Method: GET Request URL: http://127.0.0.1:8000/sitemap.xml
Django Version: 1.4.2 Python Version: 2.7.3 Installed Applications: ['prismriver', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'south', 'pinax_theme_bootstrap_account', 'pinax_theme_bootstrap', 'django_forms_bootstrap', 'account', 'metron', 'caurosel', 'politics', 'leaks', 'easy_thumbnails', 'photologue', 'debug_toolbar', 'django.contrib.comments', 'tagging', 'mptt', 'zinnia', 'django.contrib.sitemaps'] Installed Middleware: ['django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware']
Traceback: File "/home/samuel/Documents/Virtual/1.4/django2/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
Exception Type: ValueError at /sitemap.xml Exception Value: max() arg is an empty sequence
import os
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(file), os.pardir)) PACKAGE_ROOT = os.path.abspath(os.path.dirname(file))
DEBUG = True TEMPLATE_DEBUG = DEBUG
ADMINS = [
]
MANAGERS = ADMINS
DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": "dev.db", } }
EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER = 'arnoldwright1@gmail.com' EMAIL_HOST_PASSWORD = #removed for security issues
TIME_ZONE = "UTC"
LANGUAGE_CODE = "en-us"
SITE_ID = 1
USE_I18N = True
USE_L10N = True
USE_TZ = True
MEDIA_ROOT = os.path.join(PACKAGE_ROOT, "site_media", "media")
MEDIA_URL = "/media/"
STATIC_ROOT = os.path.join(PACKAGE_ROOT, "site_media", "static")
CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '127.0.0.1:11211', } }
STATIC_URL = "/static/"
STATICFILES_DIRS = [ os.path.join(PACKAGE_ROOT, "static"), ]
STATICFILES_FINDERS = [ "django.contrib.staticfiles.finders.FileSystemFinder", "django.contrib.staticfiles.finders.AppDirectoriesFinder", ]
SECRET_KEY = #removed for security issues
TEMPLATE_LOADERS = [ "django.template.loaders.filesystem.Loader", "django.template.loaders.app_directories.Loader", ]
TEMPLATE_CONTEXT_PROCESSORS = [ "django.contrib.auth.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.static", "django.core.context_processors.tz", "django.core.context_processors.request", "django.contrib.messages.context_processors.messages", "pinax_utils.context_processors.settings", "account.context_processors.account",
#zinnia
'zinnia.context_processors.version',
]
MIDDLEWARE_CLASSES = [ "django.middleware.common.CommonMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware",
#debug toolbar
'debug_toolbar.middleware.DebugToolbarMiddleware',
]
ROOT_URLCONF = "anonymous.urls"
WSGI_APPLICATION = "anonymous.wsgi.application"
TEMPLATE_DIRS = [ os.path.join(PACKAGE_ROOT, "templates"), ]
INSTALLED_APPS = [ 'prismriver', "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.sites", "django.contrib.messages", "django.contrib.staticfiles", "south",
# theme
"pinax_theme_bootstrap_account",
"pinax_theme_bootstrap",
"django_forms_bootstrap",
# external
"account",
"metron",
# project
'caurosel',
'politics',
'leaks',
'easy_thumbnails',
'photologue',
#additional
'debug_toolbar',
#zinnia
'django.contrib.comments',
'tagging',
'mptt',
'zinnia',
'django.contrib.sitemaps',
]
INTERNAL_IPS = ('127.0.0.1',)
LOGGING = { "version": 1, "disable_existing_loggers": False, "filters": { "require_debug_false": { "()": "django.utils.log.RequireDebugFalse" } }, "handlers": { "mail_admins": { "level": "ERROR", "filters": ["require_debug_false"], "class": "django.utils.log.AdminEmailHandler" } }, "loggers": { "django.request": { "handlers": ["mail_admins"], "level": "ERROR", "propagate": True, }, } }
FIXTURE_DIRS = [ os.path.join(PROJECT_ROOT, "fixtures"), ]
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
ACCOUNT_OPEN_SIGNUP = True ACCOUNT_USE_OPENID = True ACCOUNT_REQUIRED_EMAIL = False ACCOUNT_EMAIL_VERIFICATION = False ACCOUNT_EMAIL_AUTHENTICATION = False ACCOUNT_LOGIN_REDIRECT_URL = "home" ACCOUNT_LOGOUT_REDIRECT_URL = "home" ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 7
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static
from django.views.generic.simple import direct_to_template
from django.contrib import admin admin.autodiscover()
from zinnia.sitemaps import TagSitemap from zinnia.sitemaps import EntrySitemap from zinnia.sitemaps import CategorySitemap from zinnia.sitemaps import AuthorSitemap from zinnia.models.entry import Entry
from anonymous.views import *
sitemaps = {'tags': TagSitemap, 'blog': EntrySitemap, 'authors': AuthorSitemap, 'categories': CategorySitemap,}
urlpatterns = patterns("", url(r"^$", home, name="home",), url(r"^admin/", include(admin.site.urls)),
url(r"^account/", include("account.urls")),
#zinnia
url(r'^weblog/', include('zinnia.urls')),
url(r'^comments/', include('django.contrib.comments.urls')),
url(r"^contact/", contact),
url(r'^whistle/', include('leaks.urls')),
(r'^photologue', include('photologue.urls')),
)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += patterns(
'django.contrib.sitemaps.views',
url(r'^sitemap.xml$', 'index',
{'sitemaps': sitemaps}),
url(r'^sitemap-(?P
Ok I have reproduced the issue with no entries published. A fix will be written soon.
i'm trying to output the sitemap and it doesnt work because the max in sitemaps.py line 74 returns an empty list. i have posts 4 of them not sure where its getting info from