Back to WritingNote:
NOTESflaskpythonapplication-factoryweb-dev
Flask - Application Factory Pattern with create_app
December 14, 2020•Updated Feb 17, 2026

This post summarizes content from "Do it! Jump to Flask."
Sincere thanks to author Park Eung-yong and publisher "EasySpub" for making this content possible.
Do it! Jump to Flask

Note: __init__ is a Python-designated function name that automatically runs first when a module (folder) is executed.
from flask import Flask
# create_app is the application factory function designated by Flask.
# What Flask calls an "application factory" refers to a function that creates the app object.
# The reason for creating the app object inside a function (i.e., via the application factory)
# is to prevent global access to the app object, avoiding circular imports.
def create_app():
app = Flask(__name__)
@app.route('/')
def hello_pybo():
return 'Hello, Pybo!'
return app
yes24.comhttp://www.yes24.com/Product/Goods/95751850
Do it! Jump to Flask