Exemplo n.º 1
0
def create_tables():
    db.create_all()
Exemplo n.º 2
0
print(url)
app.config['SQLALCHEMY_DATABASE_URI'] = url
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app)
api = Api(app)


@app.before_first_request
def create_tables():
    db.create_all()


initialize_routes(api)

with app.app_context():
    db.create_all()


@app.route('/api/test')
def test():
    return {'test': 'Success'}

# context 생성
app.app_context().push()

# 유저 추가 (create)
# user = UserDto(userid='tom', password='******', name='tom', addr="서울시 서초구", lat=37.1234, lng=128.1234)
# UserDao.add(user)

# 유저 조회
# 전체 조회