"没有名为context_processors的模块" Django的

时间:2016-02-09 03:04:21

标签: python django django-templates django-settings django-1.7

由于django-baker的要求,我使用django 1.7获得No module named context_processors

主要网址:

from django.conf.urls import patterns, include, url
from django.contrib import admin

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

settings.py:

"""
Django settings for myproject project.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'byq8q@@!vc+!-(my3s0g)_-y4lyhvv@4+u2f-r_)v04m65ogq!'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'django_extensions',
    'django_baker',
    'bootstrapform',
    # 'emailusernames',
    'pinax_theme_bootstrap_account',
    'django_forms_bootstrap',

    'account',
    'postings',


)

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

ROOT_URLCONF = 'myproject.urls'

WSGI_APPLICATION = 'myproject.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/



TEMPLATE_DIRS = [os.path.join(BASE_DIR, "templates"),]

TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader',
                    'django.template.loaders.app_directories.Loader')


TEMPLATE_CONTEXT_PROCESSORS = [
    'django.template.context_processors.debug',
    'django.template.context_processors.request',
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages',
    'account.context_processors.account',
]


LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_URL = '/static/'


AUTHENTICATION_BACKENDS = (
    # 'emailusernames.backends.EmailAuthBackend',
    'account.auth_backends.EmailAuthenticationBackend',
    # Uncomment the following to make Django tests pass:
    # 'django.contrib.auth.backends.ModelBackend',
)

LOGIN_URL = "/accounts/login"

ACCOUNT_EMAIL_UNIQUE = True
ACCOUNT_EMAIL_CONFIRMATION_REQUIRED = True

THEME_ACCOUNT_CONTACT_EMAIL = "cchilder@mail.usf.edu"

我按照http://django-user-accounts.readthedocs.org/en/latest/installation.html上的说明操作  和http://django-user-accounts.readthedocs.org/en/latest/installation.html

我在https://github.com/pinax/pinax-theme-bootstrap-account/tree/master/pinax_theme_bootstrap_account/templates/account文档中看到了正确命名的模板,但是当我尝试http://127.0.0.1:8005/account/signup/

时会出现此错误

如何让这些pinax主题适用于django 1.7?谢谢

0 个答案:

没有答案