Move default `DATABASES` config to babybuddy.settings.base

This commit is contained in:
Christopher C. Wells 2020-06-09 07:11:25 -07:00
parent a4eb20e1ae
commit a9787f6743
3 changed files with 19 additions and 24 deletions

View File

@ -95,6 +95,17 @@ TEMPLATES = [
] ]
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Cache # Cache
# https://docs.djangoproject.com/en/3.0/topics/cache/ # https://docs.djangoproject.com/en/3.0/topics/cache/
@ -224,8 +235,10 @@ IMPORT_EXPORT_IMPORT_PERMISSION_CODE = 'add'
IMPORT_EXPORT_EXPORT_PERMISSION_CODE = 'change' IMPORT_EXPORT_EXPORT_PERMISSION_CODE = 'change'
IMPORT_EXPORT_USE_TRANSACTIONS = True IMPORT_EXPORT_USE_TRANSACTIONS = True
# Rolling session refreshes # Session configuration
# How often to refresh the session # Used by RollingSessionMiddleware to determine how often to reset the session.
# See https://docs.djangoproject.com/en/3.0/topics/http/sessions/
ROLLING_SESSION_REFRESH = 86400 ROLLING_SESSION_REFRESH = 86400
# Baby Buddy configuration # Baby Buddy configuration

View File

@ -7,17 +7,6 @@ SECRET_KEY = 'CHANGE ME'
DEBUG = True DEBUG = True
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/ # https://docs.djangoproject.com/en/3.0/howto/static-files/
# #
@ -36,4 +25,8 @@ REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] = (
'rest_framework.renderers.BrowsableAPIRenderer', 'rest_framework.renderers.BrowsableAPIRenderer',
) )
# Session configuration
# Used by RollingSessionMiddleware to determine how often to reset the session.
# See https://docs.djangoproject.com/en/3.0/topics/http/sessions/
ROLLING_SESSION_REFRESH = 1 ROLLING_SESSION_REFRESH = 1

View File

@ -7,14 +7,3 @@ SECRET_KEY = 'TRAVISCIWHYNOT'
# https://docs.djangoproject.com/en/3.0/howto/static-files/ # https://docs.djangoproject.com/en/3.0/howto/static-files/
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}