mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:29:26 +08:00
去掉 whitenoise , 使用flask static原生的功能
This commit is contained in:
+2
-1
@@ -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:]
|
||||
|
||||
Reference in New Issue
Block a user