Django ImportError when manage.py
环境: AWS EC2/Ubuntu 14.04.1/virtualenv/python 2.7/ NGINX/uWSGI 在我安装了ckeditor之后,我试图进行迁移,但出现了以下错误:Django ImportError when manage.py,django,python-2.7,ubuntu,Django,Python 2.7,Ubuntu,环境: AWS EC2/Ubuntu 14.04.1/virtualenv/python 2.7/ NGINX/uWSGI 在我安装了ckeditor之后,我试图进行迁移,但出现了以下错误: ImportError:没有名为ckeditor的模块 试一试 $ pip2.7 freeze | grep ckeditor 得到 设置.py import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)
ImportError:没有名为ckeditor的模块
试一试
$ pip2.7 freeze | grep ckeditor
得到
设置.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
回溯(最近一次呼叫最后一次):
文件“manage.py”,第10行,在
从命令行(sys.argv)执行命令
文件“/usr/local/lib/python2.7/dist-packages/django/core/management/__-init__;.py”,第385行,从命令行执行
utility.execute()
文件“/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py”,第354行,在execute中
django.setup()
文件“/usr/local/lib/python2.7/dist-packages/django/_-init__.py”,第21行,在安装程序中
应用程序。填充(设置。已安装的应用程序)
文件“/usr/local/lib/python2.7/dist packages/django/apps/registry.py”,第85行,填充
app_config=AppConfig.create(条目)
文件“/usr/local/lib/python2.7/dist packages/django/apps/config.py”,第87行,在create中
模块=导入模块(条目)
文件“/usr/lib/python2.7/importlib/_init_uuu.py”,第37行,在导入模块中
__导入(名称)
ImportError:没有名为ckeditor的模块
尝试在shell中导入ckeditor
,查看是否出现任何错误。另外,发布您的设置。填充设置。py;由于相同的错误,我无法进入shell模式。请发布您的已安装的应用程序设置。抱歉,修复此编辑器需要花费一定的时间。一直说“代码太多”可能是因为您在virtualenv之外安装了ckeditor?
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