
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
A Flask extension that provides real-time hot reload for templates, static files and Python code changes
A Flask extension that automatically refreshes your browser when you make changes to your templates, static files, or Python code.
pip install flask-hot-reload
from flask import Flask, render_template
from flask_hot_reload import HotReload
app = Flask(__name__)
# Initialize hot reload with custom watch directories
hot_reload = HotReload(app,
includes=[
'templates', # template directory
'static', # static files directory
'.' # current directory
],
excludes=[
'__pycache__',
'node_modules',
'.git'
]
)
@app.route('/')
def index():
return render_template('index.html')
if __name__ == '__main__':
app.run(debug=True)
By default, Flask Hot Reload watches the templates
and static
directories. You can customize the watched directories:
hot_reload = HotReload(app,
includes=[
'templates',
'static',
'src',
'routes'
]
)
Exclude directories that don't need monitoring:
hot_reload = HotReload(app,
excludes=[
'__pycache__',
'node_modules',
'.git',
'venv'
]
)
一个Flask扩展插件,当你修改模板、静态文件或Python代码时,浏览器会自动刷新。
pip install flask-hot-reload
from flask import Flask, render_template
from flask_hot_reload import HotReload
app = Flask(__name__)
# 使用自定义监控目录初始化热重载
hot_reload = HotReload(app,
includes=[
'templates', # 模板目录
'static', # 静态文件目录
'.' # 当前目录
],
excludes=[
'__pycache__', # 排除Python缓存目录
'node_modules', # 排除npm模块目录
'.git' # 排除git目录
]
)
@app.route('/')
def index():
return render_template('index.html')
if __name__ == '__main__':
app.run(debug=True)
默认情况下,Flask Hot Reload 会监控 templates
和 static
目录。你可以自定义监控目录:
hot_reload = HotReload(app,
includes=[
'templates',
'static',
'src',
'routes'
]
)
排除不需要监控的目录:
hot_reload = HotReload(app,
excludes=[
'__pycache__',
'node_modules',
'.git',
'venv'
]
)
MIT License
Blake Zhou (1043744584@qq.com)
FAQs
A Flask extension that provides real-time hot reload for templates, static files and Python code changes
We found that flask-hot-reload demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.