Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.config['MYSQL_HOST'] = 'localhost'
- app.config['MYSQL_USER'] = 'admin'
- app.config['MYSQL_PASSWORD'] = '********'
- app.config['MYSQL_DB'] = 'abc'
- app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
- app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://admin:********@localhost/abc'
- api = Api(app)
- db = SQLAlchemy(app)
- ma = Marshmallow(app)
- db.create_all()
- class Video(db.Model):
- id = db.Column(db.Integer, primary_key=True)
- videoid = db.Column(db.String(80), unique=True)
- video_timestamp = db.Column(db.Integer, unique=True)
- def __init__(self, videoid, video_timestamp):
- self.videoid = videoid
- self.video_timestamp = video_timestamp
Add Comment
Please, Sign In to add comment