管理员配置不当

时间:2014-06-27 22:22:39

标签: python django django-grappelli

我在这里看到了这个问题,我正在尝试不同的解决方案。我的意思是那个是指GRAPPELLI,因为我认为错误就在那里。

我收到了这个错误:

Module "django.contrib.staticfiles.storage" does not define a "CachedStaticFiles" attribute/class

此错误是指grappelli / templates / admin / base.html上的第10行,

<link href="{% static "grappelli/jquery/ui/css/custom-theme/jquery-ui-1.10.3.custom.min.css" %}"

这是我的urls.py:

urlpatterns = patterns('',
    url(r'^grappelli/', include('grappelli.urls')),
    url(r'^admin/', include(admin.site.urls)),
)

这是我的settings.py:

DEBUG = True

TEMPLATE_DEBUG = DEBUG

ALLOWED_HOSTS = ['localhost']

from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
TEMPLATE_CONTEXT_PROCESSORS = TCP + (
    'django.core.context_processors.request',
    'medio.context_processors.basico',
)

GRAPPELLI_ADMIN_TITLE = 'MY_PROJECT'

INSTALLED_APPS = (
    'grappelli',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'proyecto',
    'userprofile',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'medio.urls'

WSGI_APPLICATION = 'medio.wsgi.application'

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'medio2',
        'USER': 'root',
        'PASSWORD': '',
    }
}

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

STATIC_URL = '/static/'
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)


STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFiles'

1 个答案:

答案 0 :(得分:0)

替换

STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFiles'

STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'