“cmsplugin_filer_image”有问题。当我尝试运行服务器或进行迁移时,会显示错误:
错误:
cmsplugin_filer_image.FilerImage.cmsplugin_ptr:(fields.E300)字段定义与模型“cmsplugin”的关系,该模型未安装或是抽象的。
cmsplugin_filer_image.FilerImage.page_link:(fields.E300)字段定义与模型“page”的关系,该模型未安装或是抽象的。
我使用django 1.8.3我的OS-Linux(Ubuntu 14.04)
对不起我的英语不好)
设置.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文件管理器>=0.9
Django>=1.4
django cms>=3.0
django sekizai>=0.4.2
简单缩略图>=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行)。在line 87 of django-cms/cms/models/fields.py中,您可以看到对“cms.Page”的引用

关于python - 'cmsplugin_filer_image'(django1.8)错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32632263/

10-11 22:05
查看更多