Advertisement
MichalDK

Untitled

Apr 11th, 2021
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. from sqlalchemy import create_engine
  2. from bikesharing_models import Base, BikeSharing, Season
  3.  
  4.  
  5. CONNECTION_STRING ="mysql+pymysql://{user}:{password}@{host}/{db}"
  6.  
  7.  
  8.  
  9. eng = create_engine(
  10.         CONNECTION_STRING.format(
  11.             user="michal_dk", password="1234abcd", host="localhost", db="default"
  12. #db=pymysql.connect(host='localhost', user='michal_dk', password='1234abcd', database='todo_app')
  13.  
  14.         )
  15. )
  16.  
  17. # vytvoreni vsech tabulek z models.py
  18. Base.metadata.create_all(eng)
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement