Skip to content

Instantly share code, notes, and snippets.

@bobsilverberg
Created September 5, 2013 01:20
Show Gist options
  • Select an option

  • Save bobsilverberg/6444876 to your computer and use it in GitHub Desktop.

Select an option

Save bobsilverberg/6444876 to your computer and use it in GitHub Desktop.
settings for Moztrap
"""
Settings overrides for a particular deployment of this app. The defaults should
be suitable for local development; other settings below are likely to need
adjustment for a staging or production deployment.
Copy local.sample.py to local.py and modify as needed.
"""
#Database settings.
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "moztrap",
"USER": "root",
"HOST": "", # empty string == localhost
"PASSWORD": "",
"STORAGE_ENGINE": "InnoDB",
"OPTIONS": {
"init_command": "SET storage_engine=InnoDB",
},
}
}
#DEBUG = False
TEMPLATE_DEBUG = True
from base import LOGGING
LOGGING["handlers"]["console"] = {
"level": "DEBUG",
"class": "logging.StreamHandler",
}
LOGGING["root"] = {"handlers": ["console"]}
DEBUG_TOOLBAR = True
if DEBUG_TOOLBAR:
# for django-debug-toolbar
from .import base
base.MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware')
INTERNAL_IPS = ('127.0.0.1',)
base.INSTALLED_APPS.append("debug_toolbar")
DEBUG_TOOLBAR_PANELS = (
# 'debug_toolbar.panels.version.VersionDebugPanel',
# 'debug_toolbar.panels.timer.TimerDebugPanel',
# 'debug_toolbar.panels.timer.TimerDebugPanel',
# 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
# 'debug_toolbar.panels.headers.HeaderDebugPanel',
# 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
# 'debug_toolbar.panels.template.TemplateDebugPanel',
'debug_toolbar.panels.sql.SQLDebugPanel',
# 'debug_toolbar.panels.signals.SignalDebugPanel',
'debug_toolbar.panels.logger.LoggingPanel',
)
DEBUG_TOOLBAR_CONFIG = {
"INTERCEPT_REDIRECTS": False
}
# This must be changed to the correct live deployment URL.
#SITE_URL = "http://localhost:8000"
# Uncomment this to use username/password logins instead of BrowserID/Persona.
USE_BROWSERID = False
TEMPLATE_DEBUG = True
# This email address will get emailed on 500 server errors.
#ADMINS = [
# ("Some One", "someone@mozilla.com"),
#]
# These must be uncommented and pointed to a functioning SMTP server or users
# will not be able to register.
#EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
#EMAIL_HOST = "localhost"
#EMAIL_HOST_USER = ""
#EMAIL_HOST_PASSWORD = ""
#EMAIL_PORT = 25
#EMAIL_USE_TLS = False
# Account activation and password reset emails will come from this address
#DEFAULT_FROM_EMAIL = "do-not-reply@example.com"
# Uncomment these if the app is served over HTTPS (required for any
# production deployment to avoid session hijacking):
#SESSION_COOKIE_SECURE = True
# http://en.wikipedia.org/wiki/Strict_Transport_Security
#SECURE_HSTS_SECONDS = 86400
# A unique (and secret) key for this deployment.
#SECRET_KEY = "replace this with some random characters"
# A dictionary of shared keys for use in password hashing. Must not be empty.
# The keys in this dictionary are arbitrary string identifiers, the value is
# the HMAC shared key (which can be any random string). The shared key used for
# hashing new passwords will be the one associated with whichever identifier
# evaluates as lexicographically "last"; thus using dates in YYYY-MM-DD format
# as the identifier is natural. Any shared key found in this dictionary is
# available for use when checking passwords; thus if you remove any shared key
# from this dictionary (or change its identifier), any passwords hashed with
# that key will no longer be usable.
#HMAC_KEYS = {
# "2011-12-13": "replace this with some random characters"
#}
# Absolute path to directory where static assets will be collected by the
# "collectstatic" management command, and can be served by front-end webserver.
# Defaults to absolute filesystem path to "collected-assets/" directory.
#STATIC_ROOT = ""
# Base URL where files in STATIC_ROOT are deployed. Defaults to "/static/".
#STATIC_URL = ""
# Absolute path to directory where user-uploaded files (attachments) will be
# stored. Defaults to absolute filesystem path to "media/" directory.
#MEDIA_ROOT = ""
# Base URL where user-uploaded files will be served. In production mode,
# MozTrap will not serve these files; the front-end webserver must be
# configured to serve the files at ``MEDIA_ROOT`` at this URL. Defaults to
# "/media/".
#MEDIA_URL = ""
# If user-uploaded files should not be stored on the local filesystem, set this
# to the dotted path to a custom Django file storage backend, such as the
# Amazon S3 backend included in django-storages
# (http://code.welldev.org/django-storages/). See the Django file storage
# backend documentation: https://docs.djangoproject.com/en/dev/topics/files/
#DEFAULT_FILE_STORAGE = ""
# Causes CSS/JS to be served in a single combined, minified file, with a name
# based on contents hash (thus can be safely far-futures-expired). With the
# below two settings uncommented, run "python manage.py collectstatic" followed
# by "python manage.py compress": the contents of ``STATIC_ROOT`` can then be
# deployed into production.
#COMPRESS_ENABLED = True
#COMPRESS_OFFLINE = True
# Uncomment this (and modify LOCATION appropriately) to use memcached rather
# than local-memory cache. This (or some other out-of-process cache backend) is
# required if running MozTrap under a multi-process webserver such as
# Apache/mod_wsgi. See http://docs.djangoproject.com/en/dev/topics/cache/ for
# more configuration options. For faster caching, install pylibmc in place of
# python-memcached and replace MemcachedCache with PyLibMCCache.
#CACHES = {
# "default": {
# "BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
# "LOCATION": "127.0.0.1:11211",
# "KEY_PREFIX": "", # add a global key prefix here if necessary
# }
#}
# if DEBUG:
# LOGGING["handlers"]["console"] = {
# "level": "DEBUG",
# "class": "logging.StreamHandler",
# }
# LOGGING["root"] = {"handlers": ["console"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment