Skip to content

Commit 0a77938

Browse files
Update main.py
1 parent 6240663 commit 0a77938

File tree

1 file changed

+3
-2
lines changed
  • frameworks/Python/aiohttp/app

1 file changed

+3
-2
lines changed

frameworks/Python/aiohttp/app/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ def pg_dsn(dialect=None) -> str:
2727
"""
2828
:return: DSN url suitable for sqlalchemy and aiopg.
2929
"""
30-
return str(URL.create(
30+
url = URL.create(
3131
database='hello_world',
3232
password=os.getenv('PGPASS', 'benchmarkdbpass'),
3333
host='tfb-database',
3434
port='5432',
3535
username=os.getenv('PGUSER', 'benchmarkdbuser'),
3636
drivername='postgresql+{}'.format(dialect) if dialect else 'postgresql',
37-
))
37+
)
38+
return url.render_as_string(hide_password=False)
3839

3940

4041
async def db_ctx(app: web.Application):

0 commit comments

Comments
 (0)