def DATABASES(self): url = urlparse( secret.get('DATABASE_URL', 'postgres://*****:*****@localhost:6432/', 'Postgresql database url') ) return { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': url.path[1:], 'USER': url.username, 'PASSWORD': url.password, 'HOST': url.hostname, 'PORT': url.port, } }
) REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ( #'rest_framework.renderers.YAMLRenderer', 'rest_framework.renderers.JSONRenderer', 'rest_framework.renderers.BrowsableAPIRenderer', ), #'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',), #'PAGINATE_BY': 10 } from djset import secret as s s.prompt = DEBUG SECRET_KEY = s.get('SECRET_KEY') # 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': {
def EMAIL_HOST_PASSWORD(self): # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password return secret.get('EMAIL_HOST_PASSWORD', '')
def SECRET_KEY(self): return secret.get('SECRET_KEY')
) REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ( #'rest_framework.renderers.YAMLRenderer', 'rest_framework.renderers.JSONRenderer', 'rest_framework.renderers.BrowsableAPIRenderer', ), #'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',), #'PAGINATE_BY': 10 } from djset import secret as s s.prompt = DEBUG SECRET_KEY = s.get('SECRET_KEY') # 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' } },