michaelliao / awesome-python3-webapp

小白的Python入门教程实战篇
https://liaoxuefeng.com/books/python/
GNU General Public License v3.0
2.42k stars 2.8k forks source link

Errors in [ orm.py ] files in all branchs #21

Open willduan opened 8 years ago

willduan commented 8 years ago

in orm.py file, and in line 22. db=kw['db'] should change to db = kw['database'] since in config_default.py , you defines configs = { 'debug': True, 'db': { 'host': '123.206.28.72', 'port': 3306, 'user': 'root', 'password': '12345', 'database': 'awesome' }, 'session': { 'secret': 'AwEsOmE' } }

I runned through the code.

baitongda commented 7 years ago

Traceback (most recent call last): File "app.py", line 154, in loop.run_until_complete(init(loop)) File "/usr/local/python3/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete return future.result() File "app.py", line 142, in init yield from orm.create_pool(loop=loop, **configs.db) File "/home/wwwroot/LNMP/python_web/www/orm.py", line 20, in create_pool user=kw['awesome_user'], KeyError: 'awesome_user'