flask ??????????????????db?????????app.config????????????????????????app.config['SQLALCHEMY_DATA
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了flask ??????????????????db?????????app.config????????????????????????app.config['SQLALCHEMY_DATA相关的知识,希望对你有一定的参考价值。
?????????cat key ?????? bsp import sqli code name ash
flask ??????????????????db?????????app.config????????????????????????app.config[???SQLALCHEMY_DATABASE_URI???]
????????????????????????app.config????????????????????????????????????????????????????????????????????????
??????db????????????????????????????????????????????????URI?????????????????????????????????????????????????????????????????????
#encoding=utf-8 #from foo_orm import Model, Column, String from flask import Flask, render_template, flash, url_for, redirect from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate app = Flask(__name__) import os app.secret_key = os.getenv(???SECRET_KEY???,???secret string???) import os app.config[???SQLALCHEMY_DATABASE_URI???] = os.getenv(???DATABASE_URL???,???sqlite:///??? + os.path.join(app.root_path, ???data.db???)) app.config[???SQLALCHEMY_TRACK_MODIFICATIONS???] = False db = SQLAlchemy(app) migrate = Migrate(app, db) # ???db?????????????????????
以上是关于flask ??????????????????db?????????app.config????????????????????????app.config['SQLALCHEMY_DATA的主要内容,如果未能解决你的问题,请参考以下文章