28 lines
608 B
Python
28 lines
608 B
Python
from flask import Flask
|
|
import config
|
|
import utils.response as response
|
|
import service.faker_data as faker
|
|
# from base import db
|
|
from model import Person
|
|
|
|
app = Flask(__name__)
|
|
app.config.from_object(config)
|
|
|
|
|
|
@app.route('/')
|
|
def hello_world(): # put application's code here
|
|
return 'Hello World!'
|
|
|
|
|
|
@app.route("/faker")
|
|
def faker_data():
|
|
datas = faker.faker_identifications(2)
|
|
print(datas[0])
|
|
print(Person.__dict__.update(datas[0]))
|
|
# persons = [Person.__dict__.update(datas[index]) for index in range(len(datas))]
|
|
return response.succ({})
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app.run()
|