AttributeError: 'NoneType' object has no attribute '_instantiate_plugins' (Cannot import create_engine)

后端 未结 3 653
误落风尘
误落风尘 2021-01-26 15:16
import os

from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker

engine=create_engine(os.getenv(\"DATABASE_URL\"))
db = scoped_se         


        
3条回答
  •  被撕碎了的回忆
    2021-01-26 15:22

    instead of

       engine=create_engine(os.getenv("DATABASE_URL"))
       db = scoped_session(sessionmaker(bind=engine))
    

    type this with your url:

       engine = create_engine("postgresql://scott:tiger@localhost/mydatabase")
       db = scoped_session(sessionmaker(bind=engine))
    

提交回复
热议问题