manage.py时的Django ImportError

时间:2015-09-28 17:29:07

标签: django python-2.7 ubuntu

环境: AWS EC2 / Ubuntu 14.04.1 / virtualenv / python 2.7 / NGINX / uWSGI

我试图在pip install ckeditor之后制作移民,并收到此错误:

ImportError: No module named ckeditor

并尝试

$ pip2.7 freeze | grep ckeditor

得到

django-ckeditor==5.0.2

settings.py

import os

 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

 ALLOWED_HOSTS = []

 INSTALLED_APPS = (
    'django.contrib.admin',
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'social.apps.django_app.default',
     'ckeditor',
     'chat', )

 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',
     'django.middleware.security.SecurityMiddleware', )

 ROOT_URLCONF = 'O2.urls'


 TEMPLATES = [
     {
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
         'DIRS': [os.path.join(BASE_DIR,  'templates'),],
         'APP_DIRS': True,
         'OPTIONS': {
             'context_processors': [
                 'django.template.context_processors.debug',
                 'django.template.context_processors.request',
                 'django.contrib.auth.context_processors.auth',
                 'django.contrib.messages.context_processors.messages',

                 # Setting of Template Context Processors for Social Auth
                'social.apps.django_app.context_processors.backends',
                 'social.apps.django_app.context_processors.login_redirect',
             ],
         },
     }, ]

 WSGI_APPLICATION = 'O2.wsgi.application'

 DATABASES = {
     'default': {
         'HOST': '127.0.0.1',
         'ENGINE': '********',
         'NAME': '********',
         'USER': '*******',
         'PASSWORD': '**********',
     } }

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


 PROJECT_DIR = os.path.dirname(__file__)

 STATIC_ROOT = os.path.join(PROJECT_DIR, '../static/')

 STATIC_URL = '/static/'

 WEBSOCKET_FACTORY_CLASS =
 'dwebsocket.backends.uwsgi.factory.uWsgiWebSocketFactory'
  

所以...无法弄清楚发生了什么,

编辑:填写完整的错误代码

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 87, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named ckeditor

0 个答案:

没有答案