Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- settings_local.py
- Alexander Pitkin, [16.06.17 12:50]
- # Django settings for quidlum_com project.
- import settings
- import os
- # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- DEBUG = True
- TEMPLATE_DEBUG = DEBUG
- ALLOW_SIGNUP = True
- DEBUG_TOOLBAR_PATCH_SETTINGS = False
- GA_PROFILE_ID = 'ga:72031822'
- CORS_ORIGIN_ALLOW_ALL = True
- ADMINS = (
- # ('Your Name', 'your_email@example.com'),
- )
- MANAGERS = ADMINS
- SOCIALACCOUNT_PROVIDERS = settings.SOCIALACCOUNT_PROVIDERS
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'quidlum',
- 'USER': '',
- 'PASSWORD': '',
- 'HOST': "127.0.0.1",
- 'PORT': '5432',
- }
- }
- # 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.
- # In a Windows environment this must be set to your system time zone.
- TIME_ZONE = 'UTC'
- # Language code for this installation. All choices can be found here:
- # http://www.i18nguy.com/unicode/language-identifiers.html
- LANGUAGE_CODE = 'en-us'
- SITE_ID = 1
- # If you set this to False, Django will make some optimizations so as not
- # to load the internationalization machinery.
- USE_I18N = True
- # If you set this to False, Django will not format dates, numbers and
- # calendars according to the current locale.
- USE_L10N = True
- # If you set this to False, Django will not use timezone-aware datetimes.
- USE_TZ = True
- # Absolute filesystem path to the directory that will hold user-uploaded files.
- # Example: "/home/media/media.lawrence.com/media/"
- MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
- # 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 = 'https://quidlumdev.s3.amazonaws.com/media/'
- MEDIA_URL = '/media/'
- FILE_UPLOAD_PERMISSIONS = 0644
- # 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(BASE_DIR, 'static')
- # URL prefix for static files.
- # Example: "http://media.lawrence.com/static/"
- STATIC_URL = '/static/'
- # Additional locations of static files
- STATICFILES_DIRS = (
- # Put strings here, like "/home/html/static" or "C:/www/django/static".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
- )
- Wikipedia
- List of tz database time zones
- This is a list of time zones in the tz database release 2017b. The list is derived from the zones, links, and rules specified in zone.tab and the 7 "c...
- # 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',
- # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
- )
- # Make this unique, and don't share it with anybody.
- SECRET_KEY = '@bm9#!lhv1o0gh86^%xtwf23&b7@46w6o2z_3j-@(#6fvjxi@e'
- # List of callables that know how to import templates from various sources.
- TEMPLATE_LOADERS = (
- 'django_mobile.loader.Loader',
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader',
- # 'django.templates.loaders.eggs.Loader',
- # 'coffin.template.loaders.',
- )
- Alexander Pitkin, [16.06.17 12:50]
- TEMPLATE_CONTEXT_PROCESSORS = (
- # "cumulus.context_processors.cdn_url",
- "django.contrib.auth.context_processors.auth",
- "django.core.context_processors.debug",
- "django.core.context_processors.i18n",
- "django.core.context_processors.media",
- "django.core.context_processors.static",
- "django.core.context_processors.tz",
- "django.contrib.messages.context_processors.messages",
- "django.core.context_processors.request",
- # "allauth.account.context_processors.account",
- # "allauth.socialaccount.context_processors.socialaccount",
- "django_mobile.context_processors.flavour",
- "django.core.context_processors.csrf",
- )
- MIDDLEWARE_CLASSES = (
- 'django_hosts.middleware.HostsRequestMiddleware',
- 'corsheaders.middleware.CorsMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
- 'django_mobile.middleware.MobileDetectionMiddleware',
- 'django_mobile.middleware.SetFlavourMiddleware',
- 'django_hosts.middleware.HostsResponseMiddleware',
- )
- if DEBUG:
- MIDDLEWARE_CLASSES += (
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
- )
- ROOT_URLCONF = 'quidlum_com.urls'
- ROOT_HOSTCONF = 'quidlum_com.hosts'
- DEFAULT_HOST = 'dev'
- SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
- # Python dotted path to the WSGI application used by Django's runserver.
- WSGI_APPLICATION = 'quidlum_com.wsgi.application'
- TEMPLATE_DIRS = (
- # 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.
- )
- INSTALLED_APPS = settings.INSTALLED_APPS
- AUTHENTICATION_BACKENDS = (
- # Needed to login by username in Django admin, regardless of allauth
- "django.contrib.auth.backends.ModelBackend",
- # allauth specific authentication methods, such as login by e-mail
- "allauth.account.auth_backends.AuthenticationBackend",
- )
- # A sample logging configuration. The only tangible logging
- # performed by this configuration is to send an email to
- # the site admins on every HTTP 500 error when DEBUG=False.
- # See http://docs.djangoproject.com/en/dev/topics/logging for
- # more details on how to customize your logging configuration.
- '''LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'filters': {
- 'require_debug_false': {
- '()': 'django.utils.log.RequireDebugFalse'
- }
- },
- 'handlers': {
- 'mail_admins': {
- 'level': 'ERROR',
- 'filters': ['require_debug_false'],
- 'class': 'django.utils.log.AdminEmailHandler'
- }
- },
- 'loggers': {
- 'django.request': {
- 'handlers': ['mail_admins'],
- 'level': 'ERROR',
- 'propagate': True,
- },
- }
- }'''
- Alexander Pitkin, [16.06.17 12:50]
- LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': True,
- 'formatters': {
- 'standard': {
- 'format': "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
- 'datefmt': "%d/%b/%Y %H:%M:%S"
- },
- },
- 'handlers': {
- 'null': {
- 'level': 'DEBUG',
- 'class': 'django.utils.log.NullHandler',
- },
- 'logfile': {
- 'level': 'DEBUG',
- 'class': 'logging.handlers.RotatingFileHandler',
- 'filename': "logfile",
- 'maxBytes': 50000,
- 'backupCount': 2,
- 'formatter': 'standard',
- },
- 'console': {
- 'level': 'INFO',
- 'class': 'logging.StreamHandler',
- 'formatter': 'standard'
- },
- },
- 'loggers': {
- 'django': {
- 'handlers': ['console'],
- 'propagate': True,
- 'level': 'WARN',
- },
- 'django.db.backends': {
- 'handlers': ['console'],
- 'level': 'DEBUG',
- 'propagate': False,
- },
- 'celery': {
- 'handlers': ['logfile', 'console'],
- 'level': 'DEBUG',
- },
- '': {
- 'handlers': ['console', 'logfile'],
- 'level': 'DEBUG',
- },
- }
- }
- CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'
- # Authaticate using custom user model
- AUTH_USER_MODEL = 'qcore.QUser'
- # login url
- LOGIN_URL = '/'
- LOGIN_REDIRECT_URL = '/'
- # allauth settings
- ACCOUNT_AUTHENTICATION_METHOD = "email"
- ACCOUNT_DEFAULT_HTTP_PROTOCOL = "http"
- ACCOUNT_EMAIL_REQUIRED = True
- ACCOUNT_EMAIL_VERIFICATION = "optional"
- ACCOUNT_SIGNUP_FORM_CLASS = 'qcore.forms.SignupForm'
- ACCOUNT_USERNAME_REQUIRED = False
- ACCOUNT_PASSWORD_MIN_LENGTH = 8
- SOCIALACCOUNT_QUERY_EMAIL = True
- SOCIALACCOUNT_AUTO_SIGNUP = True
- # NEXT variable fix:
- ACCOUNT_ADAPTER = 'qcore.overloads.NextFixAdapter'
- # # Email settings
- # EMAIL_HOST = 'smtp.gmail.com'
- # EMAIL_PORT = 587
- # EMAIL_HOST_USER = 'noreply@quidlum.com'
- # EMAIL_HOST_PASSWORD = 'tGI48uUxYRj53fj17AR6'
- # EMAIL_USE_TLS = True
- # BROKER_URL = 'amqp://quidlum-task:bMzMTbg7ZVBhcbEewaYs@ip-172-31-8-35.us-west-2.compute.internal:5672/dev_tasks'
- # DEFAULT_FILE_STORAGE = 'quidlum_com.s3utils.MediaS3BotoStorage'
- # STATICFILES_STORAGE = 'quidlum_com.s3utils.StaticS3BotoStorage'
- # AWS_ACCESS_KEY_ID = 'AKIAJSG5SPYPW4XBUKXQ'
- # AWS_SECRET_ACCESS_KEY = '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'
- # AWS_STORAGE_BUCKET_NAME = 'quidlumdev'
- # AWS_QUERYSTRING_AUTH = False
- NOTIFICATIONS_USE_JSONFIELD = True
- if DEBUG:
- def show_toolbar(request):
- return True
- DEBUG_TOOLBAR_PANELS = [
- 'debug_toolbar.panels.versions.VersionsPanel',
- 'debug_toolbar.panels.timer.TimerPanel',
- 'debug_toolbar.panels.settings.SettingsPanel',
- 'debug_toolbar.panels.headers.HeadersPanel',
- 'debug_toolbar.panels.request.RequestPanel',
- 'debug_toolbar.panels.sql.SQLPanel',
- # 'debug_toolbar.panels.staticfiles.StaticFilesPanel',
- 'debug_toolbar.panels.templates.TemplatesPanel',
- 'debug_toolbar.panels.cache.CachePanel',
- # 'debug_toolbar.panels.signals.SignalsPanel',
- # 'debug_toolbar.panels.logging.LoggingPanel',
- # 'debug_toolbar.panels.redirects.RedirectsPanel',
- 'debug_toolbar.panels.profiling.ProfilingPanel',
- ]
- Alexander Pitkin, [16.06.17 12:50]
- DEBUG_TOOLBAR_CONFIG = {
- # ...
- 'SHOW_TOOLBAR_CALLBACK': "%s.show_toolbar" % __name__,
- 'DISABLE_PANELS': set(['debug_toolbar.panels.versions.VersionsPanel',
- 'debug_toolbar.panels.timer.TimerPanel',
- 'debug_toolbar.panels.settings.SettingsPanel',
- 'debug_toolbar.panels.headers.HeadersPanel',
- 'debug_toolbar.panels.request.RequestPanel',
- 'debug_toolbar.panels.sql.SQLPanel',
- # 'debug_toolbar.panels.staticfiles.StaticFilesPanel',
- 'debug_toolbar.panels.templates.TemplatesPanel',
- 'debug_toolbar.panels.cache.CachePanel',
- # 'debug_toolbar.panels.signals.SignalsPanel',
- # 'debug_toolbar.panels.logging.LoggingPanel',
- # 'debug_toolbar.panels.redirects.RedirectsPanel',
- 'debug_toolbar.panels.profiling.ProfilingPanel', ])
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement