Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 更改占位符django cms的背景色_Css_Django Templates_Django Cms - Fatal编程技术网

Css 更改占位符django cms的背景色

Css 更改占位符django cms的背景色,css,django-templates,django-cms,Css,Django Templates,Django Cms,我希望用户能够更改占位符的颜色 我尝试在后台安装djangocms css。 我放弃了这些步骤 起初,当我运行pythonmanagemigrate时,出现了一个错误:“没有找到任何模块” 不知何故,我纠正了一个错误。但是我被这个绊倒了 djangocms-css-background.CssBackground.cmsplugin_ptr: (fields.E306) The name 'djangocms-css-background_cssbackground' is invalid re

我希望用户能够更改占位符的颜色

我尝试在后台安装djangocms css。 我放弃了这些步骤

起初,当我运行pythonmanagemigrate时,出现了一个错误:“没有找到任何模块”

不知何故,我纠正了一个错误。但是我被这个绊倒了

djangocms-css-background.CssBackground.cmsplugin_ptr: (fields.E306) The name 'djangocms-css-background_cssbackground' is invalid related_name for field CssBackground.cmsplugin_ptr
    HINT: Related name must be a valid Python identifier or end with a '+'
设置.py

import os
gettext = lambda s: s
DATA_DIR = os.path.dirname(os.path.dirname(__file__))
"""
Django settings for mysite project.

Generated by 'django-admin startproject' using Django 1.8.15.

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

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

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

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


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '6!we3efe11p$%8x#r3y_)pioj5&-%%$g5ezmu2m_dm(^_f^2m8'

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

ALLOWED_HOSTS = []


# Application definition





ROOT_URLCONF = 'mysite.urls'



WSGI_APPLICATION = 'mysite.wsgi.application'


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




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

LANGUAGE_CODE = 'en'

TIME_ZONE = 'Europe/Ljubljana'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
STATIC_ROOT = os.path.join(DATA_DIR, 'static')

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'mysite', 'static'),
)
SITE_ID = 1


TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'mysite', 'templates'),],
        'OPTIONS': {
            'context_processors': [
                'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.i18n',
    'django.core.context_processors.debug',
    'django.core.context_processors.request',
    'django.core.context_processors.media',
    'django.core.context_processors.csrf',
    'django.core.context_processors.tz',
    'sekizai.context_processors.sekizai',
    'django.core.context_processors.static',
    'cms.context_processors.cms_settings'
            ],
            'loaders': [
                'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    'django.template.loaders.eggs.Loader'
            ],
        },
    },
]


MIDDLEWARE_CLASSES = (
    'cms.middleware.utils.ApphookReloadMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'cms.middleware.user.CurrentUserMiddleware',
    'cms.middleware.page.CurrentPageMiddleware',
    'cms.middleware.toolbar.ToolbarMiddleware',
    'cms.middleware.language.LanguageCookieMiddleware'
)

INSTALLED_APPS = (
    'djangocms_admin_style',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.admin',
    'django.contrib.sites',
    'django.contrib.sitemaps',
    'django.contrib.staticfiles',
    'django.contrib.messages',
    'cms',
    'menus',
    'sekizai',
    'treebeard',
    'djangocms_text_ckeditor',
    'filer',
    'easy_thumbnails',
    'djangocms_column',
    'djangocms_link',
    'cmsplugin_filer_file',
    'cmsplugin_filer_folder',
    'cmsplugin_filer_image',
    'cmsplugin_filer_utils',
    'djangocms_style',
    'djangocms_snippet',
    'djangocms_googlemap',
    'djangocms_video',
    'mysite',
    'djangocms-css-background'

)

LANGUAGES = (
    ## Customize this
    ('en', gettext('en')),
)

CMS_LANGUAGES = {
    ## Customize this
    'default': {
        'public': True,
        'hide_untranslated': False,
        'redirect_on_fallback': True,
    },
    1: [
        {
            'public': True,
            'code': 'en',
            'hide_untranslated': False,
            'name': gettext('en'),
            'redirect_on_fallback': True,
        },
    ],
}

CMS_TEMPLATES = (
    ## Customize this
    ('fullwidth.html', 'Fullwidth'),
    ('sidebar_left.html', 'Sidebar Left'),
    ('sidebar_right.html', 'Sidebar Right'),
    ('template_1.html', 'Template One'),
    ('template_2.html', 'Template Two')
)

CMS_PERMISSION = True

CMS_PLACEHOLDER_CONF = {}

DATABASES = {
    'default': {
        'CONN_MAX_AGE': 0,
        'ENGINE': 'django.db.backends.sqlite3',
        'HOST': 'localhost',
        'NAME': 'project.db',
        'PASSWORD': '',
        'PORT': '',
        'USER': ''
    }
}

MIGRATION_MODULES = {

}

THUMBNAIL_PROCESSORS = (
    'easy_thumbnails.processors.colorspace',
    'easy_thumbnails.processors.autocrop',
    'filer.thumbnail_processors.scale_and_crop_with_subject_location',
    'easy_thumbnails.processors.filters'
)
我试过了

python manage.py makemigrations djangocms-css-background
我也犯了同样的错误

我在自述文件语法中看到了+。无论我在哪里放置+,都会出现一个错误“
无效sintax

我正在使用django
1.10
,python
2.7

如果有人对此有任何建议或其他想法。
感谢您的帮助

创建了
djangocms css background
包的人对应用程序的命名很差,因为python不喜欢文件名包含连字符(-)。他们应该将包中的顶级目录命名为
djangocms\u css\u background

存储库和pypi包可以包含连字符,它只是应用程序目录

这就是你遇到问题的原因

该软件包已贬值,不再维护,快速浏览会有一些问题

您可以分叉包,解决问题,然后安装您的版本的包

但是你到底想做什么,因为我不太清楚这个问题。如果你想改变一个容器的背景颜色(就像这个应用程序允许你这么做),那么重新创建它真的很简单。我不是100%理解你所说的“占位符的背景色”


如果您提供更多信息,我可能会进一步帮助您。

创建
djangocms css后台
包的人对应用程序的命名很差,因为python不喜欢文件名包含连字符(-)。他们应该将包中的顶级目录命名为
djangocms\u css\u background

存储库和pypi包可以包含连字符,它只是应用程序目录

这就是你遇到问题的原因

该软件包已贬值,不再维护,快速浏览会有一些问题

您可以分叉包,解决问题,然后安装您的版本的包

但是你到底想做什么,因为我不太清楚这个问题。如果你想改变一个容器的背景颜色(就像这个应用程序允许你这么做),那么重新创建它真的很简单。我不是100%理解你所说的“占位符的背景色”

如果你提供更多的信息,我可能会进一步帮助你