去掉 whitenoise , 使用flask static原生的功能

pull/869/head
dami 2 months ago
parent 55d0ebad03
commit 55f7a181cd
  1. 3
      requirements.txt
  2. 7
      web/admin/__init__.py

@ -35,7 +35,7 @@ redis
pillow
Jinja2>=2.11.2
PyMySQL>=1.0.2
whitenoise==5.3.0
whitenoise>5.3.0
tldextract
pyotp
pytz
@ -49,3 +49,4 @@ packaging
Flask-Compress
brotli
zstd
zstandard

@ -53,10 +53,13 @@ cache = Cache(config={'CACHE_TYPE': 'simple'})
cache.init_app(app, config={'CACHE_TYPE': 'simple'})
# 静态文件配置
from whitenoise import WhiteNoise
app.wsgi_app = WhiteNoise(app.wsgi_app, root="../web/static/", prefix="static/", max_age=604800)
app.static_folder = "../static"
app.static_url_path = "/static"
app.jinja_env.trim_blocks = True
# from whitenoise import WhiteNoise
# app.wsgi_app = WhiteNoise(app.wsgi_app, root="../web/static/", prefix="static/", max_age=604800)
# session配置
# app.secret_key = uuid.UUID(int=uuid.getnode()).hex[-12:]
app.config['SECRET_KEY'] = uuid.UUID(int=uuid.getnode()).hex[-12:]

Loading…
Cancel
Save