对于未登录的用户,所有页面都会在站点上引发 404 错误。但是,如果我登录到管理员并返回查看该站点,则所有页面都可以正常查看。
我已经使用 Django CMS 多年了,以前没有遇到过这种情况。与此站点的唯一区别是默认语言是法语,在我的设置中我有:
LANGUAGES = [
('fr', 'Francais'),
]
作为我的语言设置,这是我的LANGUAGE_CODE
LANGUAGE_CODE = 'fr'
这是我的urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
url(r'^', include('cms.urls')),
)
if settings.DEBUG:
urlpatterns = patterns('',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
url(r'', include('django.contrib.staticfiles.urls')),
) + urlpatterns
和我的中间件...
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',
'cms.middleware.multilingual.MultilingualURLMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
)
这可能是什么原因?