0

我正在尝试配置 djangoblog 以进行异常处理,但得到以下消息,

错误:配置不当:中间件模块“djangodblog”未定义“DBLogMiddleware”类

设置.py

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',
    'djangodblog.DBLogMiddleware', 
)


INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'djangodblog',
    # Uncomment the next line to enable the admin:
    # 'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)
4

1 回答 1

2

仅在谷歌搜索后快速回答:不应该djangodblog.middleware.DBLogMiddlewaredjangodblog.DBLogMiddleware

http://nullege.com/codes/search/djangodblog.middleware.DBLogMiddleware

于 2012-06-30T21:39:10.553 回答