12
12
from servicelib .application_keys import APP_CONFIG_KEY , APP_DB_POOL_KEY
13
13
14
14
from ..db import DSN
15
- from ..email_config import CONFIG_SECTION_NAME as CONFIG_STMP_SECTION
15
+ from ..email_config import CONFIG_SECTION_NAME as SMTP_SECTION
16
16
from ..rest_config import APP_OPENAPI_SPECS_KEY
17
+ from ..db_config import CONFIG_SECTION_NAME as DB_SECTION
17
18
from .cfg import APP_LOGIN_CONFIG , cfg
18
19
from .routes import create_routes
19
20
from .storage import AsyncpgStorage
22
23
23
24
24
25
async def pg_pool (app : web .Application ):
25
- smtp_config = app [APP_CONFIG_KEY ][CONFIG_STMP_SECTION ]
26
+ smtp_config = app [APP_CONFIG_KEY ][SMTP_SECTION ]
26
27
config = {"SMTP_{}" .format (k .upper ()): v for k , v in smtp_config .items ()}
27
28
#'SMTP_SENDER': None,
28
29
#'SMTP_HOST': REQUIRED,
@@ -34,7 +35,7 @@ async def pg_pool(app: web.Application):
34
35
config = (config or {}).copy ()
35
36
config ['APP' ] = app
36
37
37
- db_config = app [APP_CONFIG_KEY ]['postgres' ]
38
+ db_config = app [APP_CONFIG_KEY ][DB_SECTION ][ 'postgres' ]
38
39
app [APP_DB_POOL_KEY ] = await asyncpg .create_pool (dsn = DSN .format (** db_config ), loop = app .loop )
39
40
40
41
# FIXME: replace by CFG_LOGIN_STORAGE
@@ -48,7 +49,7 @@ def setup(app: web.Application):
48
49
log .debug ("Setting up %s ..." , __name__ )
49
50
50
51
# TODO: requires rest ready!
51
- assert CONFIG_STMP_SECTION in app [APP_CONFIG_KEY ]
52
+ assert SMTP_SECTION in app [APP_CONFIG_KEY ]
52
53
53
54
# routes
54
55
specs = app [APP_OPENAPI_SPECS_KEY ]
0 commit comments