blender-id/blenderid/__settings.py

119 lines
3.6 KiB
Python

"""
Local development settings.
Copy to settings.py and edit to suit your needs.
"""
# noinspection PyUnresolvedReferences
from blenderid.common_settings import *
DEBUG = True
BLENDER_ID_ADDON_CLIENT_ID = "SPECIAL-SNOWFLAKE-57"
DEFAULT_FROM_EMAIL = "webmaster@localhost"
# Update this to something unique for your machine.
# This was generated using "pwgen -sync 64"
SECRET_KEY = r"""}y\[.~WGh2#~|6r|alD0R6<'WA@F#hB|4eyR\6SUyovx5H,v4TP#H~6unZGIgk~`"""
# For testing purposes, allow HTTP as well as HTTPS. Never enable this in production!
# OAUTH2_PROVIDER['ALLOWED_REDIRECT_URI_SCHEMES'] = ['http', 'https']
DATABASES = {
"default": {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'blender_id',
'USER': 'blender_id',
'PASSWORD': 'blender_id',
'HOST': '127.0.0.1',
'PORT': '5432',
}
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': str(BASE_DIR / 'db.sqlite3'),
# },
}
LOGGING = {
"version": 1,
"disable_existing_loggers": True,
"formatters": {
"default": {"format": "%(asctime)-15s %(levelname)8s %(name)s %(message)s"},
"verbose": {
"format": "%(asctime)-15s %(levelname)8s %(name)s %(process)d %(thread)d %(message)s"
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "default", # Set to 'verbose' in production
"stream": "ext://sys.stderr",
},
},
"loggers": {
"bid_main": {"level": "DEBUG"},
"blenderid": {"level": "DEBUG"},
"bid_api": {"level": "DEBUG"},
"bid_addon_support": {"level": "DEBUG"},
},
"root": {
"level": "WARNING",
"handlers": [
"console",
],
},
}
# For Debug Toolbar, extend with whatever address you use to connect
# to your dev server.
INTERNAL_IPS = ["127.0.0.1"]
# Don't use this in production, but only in tests.
# ALLOWED_HOSTS = ['*']
# Uncomment to enable Sentry in production.
#
# The send_default_pii parameter controls whether it sends personally
# identifyable information (such as user ids, usernames, cookies,
# authorization headers, ip addresses) to Sentry.
# import sys
#
# if sys.stderr.isatty():
# print('Skipping Sentry initialisation because stderr is a TTY', file=sys.stderr)
# else:
# import logging
# import sentry_sdk
# from sentry_sdk.integrations.django import DjangoIntegration
# from sentry_sdk.integrations.logging import LoggingIntegration
#
# # By default Sentry only sends ERROR level and above.
# sentry_logging = LoggingIntegration(
# level=logging.INFO, # Capture this level and above as breadcrumbs
# event_level=logging.WARNING # Send this level and above as events
# )
# sentry_sdk.init(
# dsn="https://xxxxxxxxxxxx@sentry.io/yyyyyyyyy",
# send_default_pii=False,
# integrations=[sentry_logging, DjangoIntegration()]
# )
# For development, dump email to the console instead of trying to actually send it.
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
# Alternatively, run python3 -m smtpd -n -c DebuggingServer -d '0.0.0.0:2525' and set
# EMAIL_PORT = 2525
# Hosts that we allow redirecting to with a next=xxx parameter on the /login and /switch
# endpoints; this is an addition to the defaults, for development purposes.
# NEXT_REDIR_AFTER_LOGIN_ALLOWED_HOSTS.update({
# 'cloud.local:5000', 'cloud.local:5001', 'cloud.local',
# })
if DEBUG:
MIDDLEWARE = [
'debug_toolbar.middleware.DebugToolbarMiddleware',
] + MIDDLEWARE
INSTALLED_APPS += [
'debug_toolbar',
]