Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pbansal
Test-Docker
Commits
8ed80c4f
Commit
8ed80c4f
authored
Aug 29, 2019
by
Stefan Bienert
Browse files
Container: fix container settings
parent
eb2f8188
Changes
1
Hide whitespace changes
Inline
Side-by-side
cathapi/settings/container.py
View file @
8ed80c4f
...
...
@@ -5,60 +5,36 @@ from decouple import config
from
.base
import
*
# Bend the broker to the redis container
BROKER_URL
=
'redis://cathapi-redis:6379'
CELERY_RESULT_BACKEND
=
'redis://cathapi-redis:6379'
# These settings make sure any tasks run in testing
# are run locally with the 'test' database
CELERY_ALWAYS_EAGER
=
True
TEST_RUNNER
=
'djcelery.contrib.test_runner.CeleryTestSuiteRunner'
IS_CELERY
=
config
(
'I_AM_CELERY'
,
default
=
False
,
cast
=
bool
)
if
not
IS_CELERY
:
# These settings are only relevant for Django instances
DEBUG
=
True
# Bend the Django cache to use the redis container
CACHES
[
"default"
][
"LOCATION"
]
=
"redis://cathapi-redis:6379/1"
'''
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': config('PG_NAME', default='cathapi', cast=str),
'USER': config('PG_USER', default='cathapiuser', cast=str),
'PASSWORD': config('POSTGRES_PASSWORD', cast=str),
'HOST': config('PG_HOST', default='postgres', cast=str),
'PORT': config('PG_PORT', default=5432, cast=int),
}
}
'''
# local database config
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
'NAME'
:
os
.
path
.
join
(
'/cathapi-data'
,
'db.sqlite3'
),
}
}
INSTALLED_APPS
+=
[
# 'debug_toolbar',
]
STATICFILES_DIRS
=
[
os
.
path
.
join
(
'static/'
),
]
STATIC_ROOT
=
'/static'
#MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware', ]
# These settings are only relevant for Django instances
DEBUG
=
False
# Bend the Django cache to use the redis container
CACHES
[
"default"
][
"LOCATION"
]
=
"redis://cathapi-redis:6379/1"
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.postgresql_psycopg2'
,
'NAME'
:
config
(
'POSTGRES_DB'
,
default
=
'cathapi'
,
cast
=
str
),
'USER'
:
config
(
'DJANGO_DB_USR'
,
default
=
'cathapiuser'
,
cast
=
str
),
'PASSWORD'
:
config
(
'DJANGO_DB_CLR_PW'
,
cast
=
str
),
'HOST'
:
config
(
'PG_HOST'
,
default
=
'postgres'
,
cast
=
str
),
'PORT'
:
config
(
'PG_PORT'
,
default
=
5432
,
cast
=
int
),
}
}
STATICFILES_DIRS
=
[
os
.
path
.
join
(
'static/'
),
]
STATIC_ROOT
=
'/static'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment