2017-10-14 83 views
2

我試圖用motorengine設置新的Sanic web框架(它承諾非常快),以實現100%的異步。Python 3.6 - Sanic Motorengine

我到目前爲止的設置:

app = Sanic(__name__) 

@app.listener('after_server_start') 
async def setup_dbconn(app, loop): 
    connect("database_name", username="user", password="pass", host="192.168.1.200", port=27017, io_loop=asyncio.get_event_loop()) 

不幸的是我得到:

motorengine.connection.ConnectionError: Cannot connect to database default : 
Unknown option username 

爲什麼這會崩潰?

+0

我用它的同步等效mongoengine取代了motorengine ..它按預期工作..任何人都可以參考這個嗎? –

回答