Guest User

Untitled

a guest
Jan 4th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. app.config['MYSQL_HOST'] = 'localhost'
  2. app.config['MYSQL_USER'] = 'admin'
  3. app.config['MYSQL_PASSWORD'] = '********'
  4. app.config['MYSQL_DB'] = 'abc'
  5.  
  6. app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
  7. app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://admin:********@localhost/abc'
  8.  
  9. api = Api(app)
  10. db = SQLAlchemy(app)
  11. ma = Marshmallow(app)
  12.  
  13. db.create_all()
  14.  
  15. class Video(db.Model):
  16. id = db.Column(db.Integer, primary_key=True)
  17. videoid = db.Column(db.String(80), unique=True)
  18. video_timestamp = db.Column(db.Integer, unique=True)
  19.  
  20. def __init__(self, videoid, video_timestamp):
  21. self.videoid = videoid
  22. self.video_timestamp = video_timestamp
Add Comment
Please, Sign In to add comment