繁体   English   中英

'cmsplugin_filer_image'的错误(django1.8)

[英]Errors with 'cmsplugin_filer_image' (django1.8)

我对'cmsplugin_filer_image'有疑问。 当我试图运行我的服务器或makemigrations时,它显示我错误:

错误:cmsplugin_filer_image.FilerImage.cmsplugin_ptr:(fields.E300)字段定义与模型'CMSPlugin'的关系,该模型未安装或是抽象的。 cmsplugin_filer_image.FilerImage.page_link:(fields.E300)字段定义与模型“页面”的关系,该页面未安装或是抽象的。

我使用django 1.8.3我的操作系统 - Linux(Ubuntu 14.04)

对不起,我的英语不好))

settings.py

import os

    ALLOWED_HOSTS = []


    # Application definition

    MIGRATION_MODULES = {
        'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
    }


    INSTALLED_APPS = (
        'grappelli',
        'filebrowser',
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'cub_app',
        'ckeditor',
        'ckeditor_uploader',
        'filer',
        'easy_thumbnails',
        'cmsplugin_filer_image',
        'ckeditor_filebrowser_filer',

    )

    THUMBNAIL_HIGH_RESOLUTION = True

    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 = 'cub.urls'

    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': [],
            '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',
                    "django.core.context_processors.request",
                ],
            },
        },
    ]

    WSGI_APPLICATION = 'cub.wsgi.application'


    # Database
    # https://docs.djangoproject.com/en/1.8/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.8/topics/i18n/

    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.8/howto/static-files/

    MEDIA_URL = '/media/'

    MEDIA_ROOT = os.path.join(BASE_DIR, '..', 'media')

    STATIC_URL = '/static/'

    STATIC_ROOT = '/home/igor/work/virtualenvs/cubing/src/cub/cub_app/static/'

    PORTAL_URL = 'http://localhost:8000'

    CKEDITOR_UPLOAD_PATH = "uploads/"

    CKEDITOR_JQUERY_URL = 'http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'

    CKEDITOR_UPLOAD_SLUGIFY_FILENAME = True

    TEXT_SAVE_IMAGE_FUNCTION='cmsplugin_filer_image.integrations.ckeditor.create_image_plugin'

    CMSPLUGIN_FILER_IMAGE_STYLE_CHOICES = (
        ('default', 'Default'),
        ('boxed', 'Boxed'),
    )
    CMSPLUGIN_FILER_IMAGE_DEFAULT_STYLE = 'boxed'

也许你没有遇到依赖关系?

cmsplugin-filer的github页面中说你需要安装:

  • django-filer> = 0.9
  • Django> = 1.4
  • django-cms> = 3.0
  • django-sekizai> = 0.4.2
  • easy_thumbnails> = 1.0
  • Django的appconf

这些应用程序不会出现在您的设置中。

此外,在cmsplugin-filer / cmsplugin_filer_image / models.py中你可以看到导入,特别是这部分:

from cms.models import CMSPlugin
from cms.models.fields import PageField

这些模型来自django-cms, CMSPlugin (第64行)和PageField (第81行)。 django-cms / cms / models / fields.py的第87行中,您可以看到对'cms.Page'的引用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM