Я получаю этот журнал ошибок, когда пытаюсь развернуть свое приложение на Heroku.
2020-07-12T03:19:13.340263+00:00 app[web.1]: File "/app/app/__init__.py", line 35, in <module>
2020-07-12T03:19:13.340263+00:00 app[web.1]: db.Model.metadata.reflect(db.engine)
2020-07-12T03:19:13.340263+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 943, in engine
2020-07-12T03:19:13.340264+00:00 app[web.1]: return self.get_engine()
2020-07-12T03:19:13.340264+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 962, in get_engine
2020-07-12T03:19:13.340264+00:00 app[web.1]: return connector.get_engine()
2020-07-12T03:19:13.340265+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 555, in get_engine
2020-07-12T03:19:13.340265+00:00 app[web.1]: options = self.get_options(sa_url, echo)
2020-07-12T03:19:13.340265+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 570, in get_options
2020-07-12T03:19:13.340265+00:00 app[web.1]: self._sa.apply_driver_hacks(self._app, sa_url, options)
2020-07-12T03:19:13.340268+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 883, in apply_driver_hacks
2020-07-12T03:19:13.340268+00:00 app[web.1]: if sa_url.drivername.startswith('mysql'):
2020-07-12T03:19:13.340269+00:00 app[web.1]: AttributeError: 'NoneType' object has no attribute 'drivername'
вот мой файл инициализации
app = Flask(__name__)
# Ensure responses aren't cached
@app.after_request
def after_request(response):
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
response.headers["Expires"] = 0
response.headers["Pragma"] = "no-cache"
return response
##where to find the database and initialize SQLAlchemy
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
##option to tell SQLALchemy that for every model it should just
#look at the columns that already exist in the table. This is called reflecting
db.Model.metadata.reflect(db.engine)
class Congress(db.Model):
__tablename__ = 'sen'
__table_args__ = { 'extend_existing': True }
id = db.Column(db.Text, primary_key=True)
procfile
web: flask db upgrade; gunicorn app:app
я не знаю, как исправить эту ситуацию, любая помощь будет принята