def create_app(env="DEV"): app = Flask(__name__) app.config.from_object(get_config()) db.init_app(app) db.create_all(app=app) migrate.init_app(app, db) return app
def create_app(env="DEV"): app = Flask(__name__) app.config.from_object(get_config(env)) db.init_app(app) migrate.init_app(app, db) app.register_blueprint(films_blueprint) app.register_blueprint(studios_blueprint) db.create_all(app=app) return app
def create_app(): app = Flask(__name__) app.config.from_object(run_config()) db.init_app(app) migrate.init_app(app, db) app.permanent_session_lifetime = timedelta(minutes=20) app.register_blueprint(create_db) app.register_blueprint(name_bp) return app
def create_app(): app = Flask(__name__) app.config.from_object(get_config("TEST")) db.init_app(app) migrate.init_app(app, db) app.register_blueprint(rooms_bp) app.register_blueprint(tenants_bp) app.register_blueprint(staff_bp) app.register_blueprint(health_bp) with app.app_context(): db.create_all() fill_up_db() return app
def create_app(env="DEFAULT"): app = Flask(__name__) app.config.from_object(get_config(env)) db.init_app(app) db.create_all(app=app) migrate.init_app(app, db) app.register_blueprint(school_blueprint) app.register_blueprint(student_blueprint) app.register_blueprint(teacher_blueprint) app.register_blueprint(diary_blueprint) return app
def create_app(env="TEST"): app = Flask(__name__) app.config.from_object(get_config(env)) with app.app_context(): db.init_app(app) db.create_all() migrate.init_app(app, db) app.permanent_session_lifetime = timedelta(minutes=20) app.register_blueprint(rooms_bp) app.register_blueprint(tenants_bp) app.register_blueprint(staff_bp) return app
def create_app(env=env): app = Flask(__name__) app.config.from_object(get_config(env)) with app.app_context(): db.init_app(app) jwt.init_app(app) db.create_all() migrate.init_app(app, db) app.register_blueprint(user_bp) app.register_blueprint(shop_bp) app.register_blueprint(product_bp) app.register_blueprint(order_bp) app.register_blueprint(category_bp) app.register_blueprint(shops_products_bp) return app
migrate, ) from models.user import User from models.post import Post from admin import admin app = Flask(__name__) app.config.from_pyfile("configs.py") admin.init_app(app) db.init_app(app) ## db.init_app(app) migrate.init_app(app, db) # 로그인 되있으면 메인, 아니면 로그인창 @app.route("/") def hello(): return login() @app.route("/main") def main(): return render_template("index.html") def login(): username = request.cookies.get('username', None)
@APP.cli.command() def initdb(): try: initialize_database() except LookupError: import nltk nltk.download('stopwords') nltk.download('punkt') initialize_database() def initialize_database(): print('DELETING CURRENT ROWS') WordEntryModel.query.delete() print('DELETE COMPLETE') set_up_words() API.add_resource(WordEntry, '/wordentry/<string:word>') API.add_resource(WordEntryList, '/wordentries') API.add_resource(Sentence, '/sentence') if __name__ == '__main__': from db import db db.init_app(APP) APP.run(port=5000) else: from db import db, migrate db.init_app(APP) migrate.init_app(APP, db)
class Room(): roomNum = -1 roomName = "" roomPassword = "" roomPeople = [] rooms = [] app = Flask(__name__) app.config.from_pyfile("configs.py") admin.init_app(app) db.init_app(app) migrate.init_app(app, db) socketio = SocketIO(app, logger=True) app.route("/login", methods=["POST"])(login) app.route("/signUp", methods=["POST"])(signUp) @socketio.on('broadcast event') def broadcast_message(message): emit('broadcast event', {'data': message['data']}, broadcast=True) @socketio.on('room list') def room_list(): print("띠용")