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

后端 未结 3 656
误落风尘
误落风尘 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:30

    It looks like os.getenv("DATABASE_URL") is returning None. Calling create_engine(None) give you this error. Is DATABASE_URL defined in your environment variable ?

提交回复
热议问题