设置时尝试处理文件浏览器时出现某个SECRET_KEY的错误

时间:2015-04-23 16:10:39

标签: django mezzanine

我遇到这样的消息: 我不会使用widgy获取信息,只需使用3.1.10的Mezzanine和Django 1.6.11

Traceback (most recent call last):
  File "C:\Users\olive\git\MezzanineRoxdev\MezzWidgy\manage.py", line 10, in <module>
from MezzWidgy.settings import PROJECT_ROOT, PROJECT_DIRNAME
  File "C:\Users\olive\git\MezzanineRoxdev\MezzWidgy\MezzWidgy\settings.py", line 3, in <module>
from filebrowser import settings
  File "C:\DjangoMezzaEnvironnement\lib\site-packages\filebrowser\settings.py", line 15, in <module>
MEDIA_ROOT = getattr(settings, "FILEBROWSER_MEDIA_ROOT", settings.MEDIA_ROOT)
  File "C:\DjangoMezzaEnvironnement\lib\site-packages\django\conf\__init__.py", line 54, in __getattr__
self._setup(name)
  File "C:\DjangoMezzaEnvironnement\lib\site-packages\django\conf\__init__.py", line 49, in _setup
self._wrapped = Settings(settings_module)
  File "C:\DjangoMezzaEnvironnement\lib\site-packages\django\conf\__init__.py", line 151, in __init__
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")

django.core.exceptions.ImproperlyConfigured:SECRET_KEY设置不能为空。

我的设置是:

from __future__ import absolute_import, unicode_literals
#from django.conf import settings
from filebrowser import settings
from filebrowser.sites import site
from base import *
######################
# MEZZANINE SETTINGS #
######################

# The following settings are already defined with default values in
# the ``defaults.py`` module within each of Mezzanine's apps, but are
# common enough to be put here, commented out, for convenient
# overriding. Please consult the settings documentation for a full list
# of settings Mezzanine implements:
# http://mezzanine.jupo.org/docs/configuration.html#default-settings

# Controls the ordering and grouping of the admin menu.
#
ADMIN_MENU_ORDER = (
     ("Content", ("pages.Page", "blog.BlogPost",
        "generic.ThreadedComment", ("Media Library", "fb_browse"),)),
     ("Site", ("sites.Site", "redirects.Redirect", "conf.Setting")),
     ("Users", ("auth.User", "auth.Group",)),
 )

# A three item sequence, each containing a sequence of template tags
# used to render the admin dashboard.
#
# DASHBOARD_TAGS = (
#     ("blog_tags.quick_blog", "mezzanine_tags.app_list"),
#     ("comment_tags.recent_comments",),
#     ("mezzanine_tags.recent_actions",),
# )

# A sequence of templates used by the ``page_menu`` template tag. Each
# item in the sequence is a three item sequence, containing a unique ID
# for the template, a label for the template, and the template path.
# These templates are then available for selection when editing which
# menus a page should appear in. Note that if a menu template is used
# that doesn't appear in this setting, all pages will appear in it.



# EXTRA_MODEL_FIELDS = (
#     (
#         # Dotted path to field.
#         "mezzanine.blog.models.BlogPost.image",
#         # Dotted path to field class.
#         "somelib.fields.ImageField",
#         # Positional args for field class.
#         ("Image",),
#         # Keyword args for field class.
#         {"blank": True, "upload_to": "blog"},
#     ),
#     # Example of adding a field to *all* of Mezzanine's content types:
#     (
#         "mezzanine.pages.models.Page.another_field",
#         "IntegerField", # 'django.db.models.' is implied if path is omitted.
#         ("Another name",),
#         {"blank": True, "default": 1},
#     ),
# )

# Setting to turn on featured images for blog posts. Defaults to False.
#
# BLOG_USE_FEATURED_IMAGE = True

# If True, the south application will be automatically added to the
# INSTALLED_APPS setting.
USE_SOUTH = True


########################
# MAIN DJANGO SETTINGS #
########################

# People who get code error notifications.
# In the format (('Full Name', 'email@example.com'),
#                ('Full Name', 'anotheremail@example.com'))

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


ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS

# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = "Europe/Paris"

# If you set this to True, Django will use timezone-aware datetimes.
USE_TZ = True

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = "fr-FR"

# Supported languages

_ = lambda s: s
LANGUAGES = (
    ('en', _('English')),
)


# A boolean that turns on/off debug mode. When set to ``True``, stack traces
# are displayed for error pages. Should always be set to ``False`` in
# production. Best set to ``True`` in local_settings.py
DEBUG = True

# Whether a user's session cookie expires when the Web browser is closed.
SESSION_EXPIRE_AT_BROWSER_CLOSE = True

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = False

# Tuple of IP addresses, as strings, that:
#   * See debug comments, when DEBUG is true
#   * Receive x-headers
INTERNAL_IPS = ("127.0.0.1",)

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    "django.template.loaders.filesystem.Loader",
    "django.template.loaders.app_directories.Loader",
)

AUTHENTICATION_BACKENDS = ("mezzanine.core.auth_backends.MezzanineBackend",)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    "django.contrib.staticfiles.finders.FileSystemFinder",
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
    'compressor.finders.CompressorFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# The numeric mode to set newly-uploaded files to. The value should be
# a mode you'd pass directly to os.chmod.
FILE_UPLOAD_PERMISSIONS = 0o644


#############
# DATABASES #
#############


DATABASES = {
    "default": {
        # Add "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
        "ENGINE": "django.db.backends.sqlite3",
        # DB name or path to database file if using sqlite3.
        "NAME": os.path.join(BASE_DIR, 'db.sqlite3'),
        # Not used with sqlite3.
        "USER": "",
        # Not used with sqlite3.
        "PASSWORD": "",
        # Set to empty string for localhost. Not used with sqlite3.
        "HOST": "",
        # Set to empty string for default. Not used with sqlite3.
        "PORT": "",
    }
}


#########
# PATHS #
#########

import os

# Full filesystem path to the project.
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))

# Name of the directory for the project.
PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]

# Every cache key will get prefixed with this value - here we set it to
# the name of the directory the project is in to try and use something
# project specific.
CACHE_MIDDLEWARE_KEY_PREFIX = PROJECT_DIRNAME

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = "/static/"

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL.strip("/"))





# Put strings here, like "/home/html/django_templates"
# or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, "templates"),)

TEMPLATE_DEBUG = True
################
# APPLICATIONS #
################




COMPRESS_ENABLED = True

COMPRESS_PRECOMPILERS = (
    ('text/x-scss', 'django_libsass.SassCompiler'),
)

COMPRESS_URL = STATIC_URL
COMPRESS_ROOT = STATIC_ROOT

GRAPPELLI_INSTALLED = True
# Store these package names here as they may change in the future since
# at the moment we are using custom forks of them.
PACKAGE_NAME_FILEBROWSER = "filebrowser_safe"
PACKAGE_NAME_GRAPPELLI = "grappelli_safe"


#########################
# OPTIONAL APPLICATIONS #
#########################

# These will be added to ``INSTALLED_APPS``, only if available.
OPTIONAL_APPS = (
    "debug_toolbar",
    "django_extensions",
    "compressor",
    PACKAGE_NAME_FILEBROWSER,
    PACKAGE_NAME_GRAPPELLI,
)


INSTALLED_APPS = (

    #'grappelli',
    #'filebrowser',
    #PACKAGE_NAME_GRAPPELLI,
    #PACKAGE_NAME_FILEBROWSER,
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.redirects",
    "django.contrib.sessions",
    "django.contrib.sites",
    "django.contrib.sitemaps",
    "django.contrib.staticfiles",
    "django.contrib.comments",
    "mezzanine.boot",
    "mezzanine.conf",
    "mezzanine.core",
    "mezzanine.generic",
    "mezzanine.blog",
    "mezzanine.forms",
    "mezzanine.pages",
    "mezzanine.galleries",
    "mezzanine.twitter",
    "mezzanine_slides",
    'photologue',
    'sortedm2m',
    'south',
    'sorl.thumbnail',


    #"django_libsass",
    #"mezzanine.accounts",
    #"mezzanine.mobile",
)

TESTING = ""
# List of processors used by RequestContext to populate the context.
# Each one should be a callable that takes the request object as its
# only parameter and returns a dictionary to add to the context.
TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.contrib.messages.context_processors.messages",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.static",
    "django.core.context_processors.media",
    "django.core.context_processors.request",
    "django.core.context_processors.tz",
    "mezzanine.conf.context_processors.settings",
    "mezzanine.pages.context_processors.page",
)

# List of middleware classes to use. Order is important; in the request phase,
# these middleware classes will be applied in the order given, and in the
# response phase the middleware will be applied in reverse order.
MIDDLEWARE_CLASSES = (
    "mezzanine.core.middleware.UpdateCacheMiddleware",
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.locale.LocaleMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "mezzanine.core.request.CurrentRequestMiddleware",
    "mezzanine.core.middleware.RedirectFallbackMiddleware",
    "mezzanine.core.middleware.TemplateForDeviceMiddleware",
    "mezzanine.core.middleware.TemplateForHostMiddleware",
    "mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware",
    "mezzanine.core.middleware.SitePermissionMiddleware",
    # Uncomment the following if using any of the SSL settings:
    # "mezzanine.core.middleware.SSLRedirectMiddleware",
    "mezzanine.pages.middleware.PageMiddleware",
    "mezzanine.core.middleware.FetchFromCacheMiddleware",
)


# Package/module name to import the root urlpatterns from for the project.
ROOT_URLCONF = "%s.urls" % PROJECT_DIRNAME

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = STATIC_URL + "media/"

# Configuration filebrowser

site.directory = "uploads/"

MEDIA_URL = getattr(settings, "FILEBROWSER_MEDIA_URL", settings.MEDIA_URL)
MEDIA_ROOT = getattr(settings, "FILEBROWSER_MEDIA_ROOT", settings.MEDIA_ROOT)
DIRECTORY = getattr(settings, "FILEBROWSER_DIRECTORY", 'uploads/')
#Fin de Configuration filebrowser

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
#MEDIA_ROOT = os.path.join(PROJECT_ROOT, *MEDIA_URL.strip("/").split("/"))

SECRET_KEY = "ec6b7f1a-6f61-4b6a-85b7-8851649baa041f90c4b8-65ff-4455-b5c5"

###################
# DEPLOY SETTINGS #
###################

# These settings are used by the default fabfile.py provided.
# Check fabfile.py for defaults.

# FABRIC = {
#     "SSH_USER": "", # SSH username for host deploying to
#     "HOSTS": ALLOWED_HOSTS[:1], # List of hosts to deploy to (eg, first host)
#     "DOMAINS": ALLOWED_HOSTS, # Domains for public site
#     "REPO_URL": "ssh://hg@bitbucket.org/user/project", # Project's repo URL
#     "VIRTUALENV_HOME":  "", # Absolute remote path for virtualenvs
#     "PROJECT_NAME": "", # Unique identifier for project
#     "REQUIREMENTS_PATH": "requirements.txt", # Project's pip requirements
#     "GUNICORN_PORT": 8000, # Port gunicorn will listen on
#     "LOCALE": "en_US.UTF-8", # Should end with ".UTF-8"
#     "DB_PASS": "", # Live database password
#     "ADMIN_PASS": "", # Live admin user password
#     "SECRET_KEY": SECRET_KEY,
#     "NEVERCACHE_KEY": NEVERCACHE_KEY,
# }


##################
# LOCAL SETTINGS #
##################

# Allow any settings to be defined in local_settings.py which should be
# ignored in your version control system allowing for settings to be
# defined per machine.
try:
    from local_settings import *
except ImportError as e:
    if "local_settings" not in str(e):
        raise e


####################
# DYNAMIC SETTINGS #
####################

# set_dynamic_settings() will rewrite globals based on what has been
# defined so far, in order to provide some better defaults where
# applicable. We also allow this settings module to be imported
# without Mezzanine installed, as the case may be when using the
# fabfile, where setting the dynamic settings below isn't strictly
# required.
try:
    from mezzanine.ut

    from __future__ import absolute_import, unicode_literals
    #from django.conf import settings
    from filebrowser import settings
    from filebrowser.sites import site
    from base import *
    ######################
    # MEZZANINE SETTINGS #
    ######################

    # The following settings are already defined with default values in
    # the ``defaults.py`` module within each of Mezzanine's apps, but are
    # common enough to be put here, commented out, for convenient
    # overriding. Please consult the settings documentation for a full list
    # of settings Mezzanine implements:
    # http://mezzanine.jupo.org/docs/configuration.html#default-settings

    # Controls the ordering and grouping of the admin menu.
    #
    ADMIN_MENU_ORDER = (
         ("Content", ("pages.Page", "blog.BlogPost",
            "generic.ThreadedComment", ("Media Library", "fb_browse"),)),
         ("Site", ("sites.Site", "redirects.Redirect", "conf.Setting")),
         ("Users", ("auth.User", "auth.Group",)),
     )

    # A three item sequence, each containing a sequence of template tags
    # used to render the admin dashboard.
    #
    # DASHBOARD_TAGS = (
    #     ("blog_tags.quick_blog", "mezzanine_tags.app_list"),
    #     ("comment_tags.recent_comments",),
    #     ("mezzanine_tags.recent_actions",),
    # )

    # A sequence of templates used by the ``page_menu`` template tag. Each
    # item in the sequence is a three item sequence, containing a unique ID
    # for the template, a label for the template, and the template path.
    # These templates are then available for selection when editing which
    # menus a page should appear in. Note that if a menu template is used
    # that doesn't appear in this setting, all pages will appear in it.

    # PAGE_MENU_TEMPLATES = (
    #     (1, "Top navigation bar", "pages/menus/dropdown.html"),
    #     (2, "Left-hand tree", "pages/menus/tree.html"),
    #     (3, "Footer", "pages/menus/footer.html"),
    # )

    USE_SOUTH = True


    ########################
    # MAIN DJANGO SETTINGS #
    ########################

    # People who get code error notifications.
    # In the format (('Full Name', 'email@example.com'),
    #                ('Full Name', 'anotheremail@example.com'))

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


    ADMINS = (
        # ('Your Name', 'your_email@domain.com'),
    )
    MANAGERS = ADMINS

    # Hosts/domain names that are valid for this site; required if DEBUG is False
    # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
    ALLOWED_HOSTS = []
 
    TIME_ZONE = "Europe/Paris"

    # If you set this to True, Django will use timezone-aware datetimes.
    USE_TZ = True

    # Language code for this installation. All choices can be found here:
    # http://www.i18nguy.com/unicode/language-identifiers.html
    LANGUAGE_CODE = "fr-FR"

    # Supported languages

    _ = lambda s: s
    LANGUAGES = (
        ('en', _('English')),
    )


    # A boolean that turns on/off debug mode. When set to ``True``, stack traces
    # are displayed for error pages. Should always be set to ``False`` in
    # production. Best set to ``True`` in local_settings.py
    DEBUG = True

    # Whether a user's session cookie expires when the Web browser is closed.
    SESSION_EXPIRE_AT_BROWSER_CLOSE = True

    SITE_ID = 1

    # If you set this to False, Django will make some optimizations so as not
    # to load the internationalization machinery.
    USE_I18N = False

    # Tuple of IP addresses, as strings, that:
    #   * See debug comments, when DEBUG is true
    #   * Receive x-headers
    INTERNAL_IPS = ("127.0.0.1",)

    # List of callables that know how to import templates from various sources.
    TEMPLATE_LOADERS = (
        "django.template.loaders.filesystem.Loader",
        "django.template.loaders.app_directories.Loader",
    )

    AUTHENTICATION_BACKENDS = ("mezzanine.core.auth_backends.MezzanineBackend",)

    # List of finder classes that know how to find static files in
    # various locations.
    STATICFILES_FINDERS = (
        "django.contrib.staticfiles.finders.FileSystemFinder",
        "django.contrib.staticfiles.finders.AppDirectoriesFinder",
        'compressor.finders.CompressorFinder',
    #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
    )

    # The numeric mode to set newly-uploaded files to. The value should be
    # a mode you'd pass directly to os.chmod.
    FILE_UPLOAD_PERMISSIONS = 0o644    
                   
    #########
    # PATHS #
    #########

    import os

    # Full filesystem path to the project.
    PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))

    # Name of the directory for the project.
    PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]

    STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL.strip("/"))





   

    TEMPLATE_DEBUG = True
    ################
    # APPLICATIONS #
    ################




    COMPRESS_ENABLED = True

    COMPRESS_PRECOMPILERS = (
        ('text/x-scss', 'django_libsass.SassCompiler'),
    )

    COMPRESS_URL = STATIC_URL
    COMPRESS_ROOT = STATIC_ROOT

    GRAPPELLI_INSTALLED = True
    # Store these package names here as they may change in the future since
    # at the moment we are using custom forks of them.
    PACKAGE_NAME_FILEBROWSER = "filebrowser_safe"
    PACKAGE_NAME_GRAPPELLI = "grappelli_safe"


    #########################
    # OPTIONAL APPLICATIONS #
    #########################

    # These will be added to ``INSTALLED_APPS``, only if available.
    OPTIONAL_APPS = (
        "debug_toolbar",
        "django_extensions",
        "compressor",
        PACKAGE_NAME_FILEBROWSER,
        PACKAGE_NAME_GRAPPELLI,
    )
    
    INSTALLED_APPS = (            
        
        "django.contrib.admin",
        "django.contrib.auth",
        "django.contrib.contenttypes",
        "django.contrib.redirects",
        "django.contrib.sessions",
        "django.contrib.sites",
        "django.contrib.sitemaps",
        "django.contrib.staticfiles",
        "django.contrib.comments",
        "mezzanine.boot",
        "mezzanine.conf",
        "mezzanine.core",
        "mezzanine.generic",
        "mezzanine.blog",
        "mezzanine.forms",
        "mezzanine.pages",
        "mezzanine.galleries",
        "mezzanine.twitter",
        "mezzanine_slides",
        'photologue',
        'sortedm2m',
        'south',
        'sorl.thumbnail',
        
        
        #"django_libsass",
        #"mezzanine.accounts",
        #"mezzanine.mobile",
    )

    TESTING = ""
    # List of processors used by RequestContext to populate the context.
    # Each one should be a callable that takes the request object as its
    # only parameter and returns a dictionary to add to the context.
    TEMPLATE_CONTEXT_PROCESSORS = (
        "django.contrib.auth.context_processors.auth",
        "django.contrib.messages.context_processors.messages",
        "django.core.context_processors.debug",
        "django.core.context_processors.i18n",
        "django.core.context_processors.static",
        "django.core.context_processors.media",
        "django.core.context_processors.request",
        "django.core.context_processors.tz",
        "mezzanine.conf.context_processors.settings",
        "mezzanine.pages.context_processors.page",
    )

    # List of middleware classes to use. Order is important; in the request phase,
    # these middleware classes will be applied in the order given, and in the
    # response phase the middleware will be applied in reverse order.
    MIDDLEWARE_CLASSES = (
        "mezzanine.core.middleware.UpdateCacheMiddleware",
        "django.contrib.sessions.middleware.SessionMiddleware",
        "django.middleware.locale.LocaleMiddleware",
        "django.contrib.auth.middleware.AuthenticationMiddleware",
        "django.middleware.common.CommonMiddleware",
        "django.middleware.csrf.CsrfViewMiddleware",
        "django.contrib.messages.middleware.MessageMiddleware",
        "mezzanine.core.request.CurrentRequestMiddleware",
        "mezzanine.core.middleware.RedirectFallbackMiddleware",
        "mezzanine.core.middleware.TemplateForDeviceMiddleware",
        "mezzanine.core.middleware.TemplateForHostMiddleware",
        "mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware",
        "mezzanine.core.middleware.SitePermissionMiddleware",
        # Uncomment the following if using any of the SSL settings:
        # "mezzanine.core.middleware.SSLRedirectMiddleware",
        "mezzanine.pages.middleware.PageMiddleware",
        "mezzanine.core.middleware.FetchFromCacheMiddleware",
    )


    # Package/module name to import the root urlpatterns from for the project.
    ROOT_URLCONF = "%s.urls" % PROJECT_DIRNAME

    # URL that handles the media served from MEDIA_ROOT. Make sure to use a
    # trailing slash.
    # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
    MEDIA_URL = STATIC_URL + "media/"

    # Configuration filebrowser

    site.directory = "uploads/"

    MEDIA_URL = getattr(settings, "FILEBROWSER_MEDIA_URL", settings.MEDIA_URL)
    MEDIA_ROOT = getattr(settings, "FILEBROWSER_MEDIA_ROOT", settings.MEDIA_ROOT)
    DIRECTORY = getattr(settings, "FILEBROWSER_DIRECTORY", 'uploads/')
    #Fin de Configuration filebrowser

    # Absolute filesystem path to the directory that will hold user-uploaded files.
    # Example: "/home/media/media.lawrence.com/media/"
    #MEDIA_ROOT = os.path.join(PROJECT_ROOT, *MEDIA_URL.strip("/").split("/"))

    SECRET_KEY = "ec6b7f1a-6f61-4b6a-85b7-8851649baa041f90c4b8-65ff-4455-b5c5"
   
    ##################
    # LOCAL SETTINGS #
    ##################

    # Allow any settings to be defined in local_settings.py which should be
    # ignored in your version control system allowing for settings to be
    # defined per machine.
    try:
        from local_settings import *
    except ImportError as e:
        if "local_settings" not in str(e):
            raise e


    ####################
    # DYNAMIC SETTINGS #
    ####################

    # set_dynamic_settings() will rewrite globals based on what has been
    # defined so far, in order to provide some better defaults where
    # applicable. We also allow this settings module to be imported
    # without Mezzanine installed, as the case may be when using the
    # fabfile, where setting the dynamic settings below isn't strictly
    # required.
    try:
        from mezzanine.utils.conf import set_dynamic_settings
    except ImportError:
        pass
    else:
        set_dynamic_settings(globals())
ils.conf import set_dynamic_settings except ImportError: pass else: set_dynamic_settings(globals())

1 个答案:

答案 0 :(得分:0)

您需要在setting.py

中设置密钥

示例:

`SECRET_KEY =  '^q^_367g#+93n)))w-a4*l2k!hoep)r2dnsj^vv(282#e1jd$'`