SQLAlchemy no password supplied error

后端 未结 4 552
情话喂你
情话喂你 2020-12-23 16:27

This is probably a silly error but I cannot seem to find a satisfying solution.

When running db.create_all(), I got the following error.



        
4条回答
  •  梦毁少年i
    2020-12-23 16:56

    Below worked for me. Your connection to your postgres database requires a password; thus, below is what you should write..

    pg_user = "magicmike"
    pg_pwd = "test123"
    pg_port = "5432"
    app.config["SQLALCHEMY_DATABASE_URI"] = "postgresql://{username}:{password}@localhost:{port}/foodversity_db".format(username=pg_user, password=pg_pwd, port=pg_port)
    

提交回复
热议问题