我的__init__.py
:
from flask import Flask
from flask.ext.mongoengine import MongoEngine
app = Flask(__name__)
app.config["MONGODB_SETTINGS"] = {'DB': "sencha_web_service", 'username': "<username>", "password": "<password>"}
app.config["SECRET_KEY"] = "KeepThisS3cr3t"
db = MongoEngine(app)
if __name__ == '__main__':
app.run()
我得到错误:
mongoengine.connection.ConnectionError: Cannot connect to database default :
False is not a read preference.
我尝试传入但仍然遇到相同的错误"alias"="default"
。 app.config["MONGODB_SETTINGS"]