django-cmz - cmsplugin_zinnia - 错误模板404.html / 500.html

时间:2012-06-21 08:45:32

标签: django django-cms

我正在尝试为django-cms和cmsplugin-zinnia设置默认的Django错误处理程序,但由于某种原因,我无法完成它。

每当我输入不存在的URL时,我都会收到默认的错误消息:

“百日草的博客 只是另一个百日草博客。 /错误500“

我的settings.py配置为:

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.comments',
'django.contrib.staticfiles',
'cms',
'mptt',
'south',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.link',
'cms.plugins.file',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'django.contrib.sitemaps',
'sekizai',
'menus',
'filer',
'djangocms_utils',
'simple_translation',
'tagging',
'zinnia',
'cmsplugin_zinnia',
'django.contrib.sitemaps',
'cmsplugin_contact',

和url.py

urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^', include('cms.urls')),

if settings.DEBUG:
urlpatterns = patterns('',
    url(r'sitemap.xml/$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': {'cmspages': CMSSitemap}}),
    url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
    {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
    url(r'', include('django.contrib.staticfiles.urls')),
    url(r'^weblog/', include('zinnia.urls')),
    url(r'^comments/', include('django.contrib.comments.urls')),
) + urlpatterns

有什么建议吗?

干杯,

1 个答案:

答案 0 :(得分:0)

我认为您可以通过创建自己的404.html和500.html模板来解决您的问题。

此致