Skip to content

Commit

Permalink
cleanup base config (#1389)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Jun 28, 2024
1 parent 5c67688 commit 03b38b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
env = environ.Env()

# .env file, should load only in development environment
READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', default=False)
READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', False)

if READ_DOT_ENV_FILE:
# Operating System Environment variables have precedence over variables
Expand Down Expand Up @@ -151,9 +151,7 @@
# See: https://docs.djangoproject.com/en/4.2/ref/settings/#databases
# Uses django-environ to accept uri format
# See: https://django-environ.readthedocs.io/en/latest/#supported-types
DATABASES = {
'default': env.db('DATABASE_URL', default='postgres:///sodar_core')
}
DATABASES = {'default': env.db('DATABASE_URL', 'postgres:///sodar_core')}
DATABASES['default']['ATOMIC_REQUESTS'] = True

# Set default auto field (for Django 3.2+)
Expand Down Expand Up @@ -580,10 +578,10 @@ def set_logging(level=None):
'PROJECTROLES_SEARCH_OMIT_APPS', None, []
)
PROJECTROLES_TARGET_SYNC_ENABLE = env.bool(
'PROJECTROLES_TARGET_SYNC_ENABLE', default=False
'PROJECTROLES_TARGET_SYNC_ENABLE', False
)
PROJECTROLES_TARGET_SYNC_INTERVAL = env.int(
'PROJECTROLES_TARGET_SYNC_INTERVAL', default=5
'PROJECTROLES_TARGET_SYNC_INTERVAL', 5
)

# Optional projectroles settings
Expand Down
4 changes: 2 additions & 2 deletions config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
DEBUG = env.bool('DJANGO_DEBUG', True)
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG

# SECRET CONFIGURATION
Expand Down Expand Up @@ -49,7 +49,7 @@

# django-debug-toolbar
# ------------------------------------------------------------------------------
ENABLE_DEBUG_TOOLBAR = env.bool('ENABLE_DEBUG_TOOLBAR', default=True)
ENABLE_DEBUG_TOOLBAR = env.bool('ENABLE_DEBUG_TOOLBAR', True)

if ENABLE_DEBUG_TOOLBAR:
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware']
Expand Down

0 comments on commit 03b38b4

Please sign in to comment.