mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-09 19:27:55 +02:00
➕(backend) add servestatic dependency
We removed previously whitenoise because it was not working with asgi application. By removing it we also removed the way to serve the static files in the application. There is an existing fork of whitenoise, servestatic, that manage async application and we can use it to serve static files.
This commit is contained in:
@@ -14,6 +14,7 @@ and this project adheres to
|
||||
|
||||
- 🐛(frontend) hide Leave in the doc menu when not logged in #2626
|
||||
- 🐛(backend) allow to configure settings DATA_UPLOAD_MAX_MEMORY_SIZE
|
||||
- ➕(backend) add servestatic dependency
|
||||
|
||||
## [v5.6.0] - 2026-09-03
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ class Base(Configuration):
|
||||
},
|
||||
"staticfiles": {
|
||||
"BACKEND": values.Value(
|
||||
"django.contrib.staticfiles.storage.StaticFilesStorage",
|
||||
"servestatic.storage.CompressedManifestStaticFilesStorage",
|
||||
environ_name="STORAGES_STATICFILES_BACKEND",
|
||||
),
|
||||
},
|
||||
@@ -356,6 +356,7 @@ class Base(Configuration):
|
||||
|
||||
MIDDLEWARE = [
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"servestatic.middleware.ServeStaticMiddleware",
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"django.middleware.locale.LocaleMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
@@ -381,6 +382,7 @@ class Base(Configuration):
|
||||
# impress
|
||||
"core",
|
||||
"demo",
|
||||
"servestatic",
|
||||
"drf_spectacular",
|
||||
# Third party apps
|
||||
"corsheaders",
|
||||
@@ -1302,7 +1304,7 @@ class Build(Base):
|
||||
},
|
||||
"staticfiles": {
|
||||
"BACKEND": values.Value(
|
||||
"django.contrib.staticfiles.storage.StaticFilesStorage",
|
||||
"servestatic.storage.CompressedManifestStaticFilesStorage",
|
||||
environ_name="STORAGES_STATICFILES_BACKEND",
|
||||
),
|
||||
},
|
||||
@@ -1374,6 +1376,18 @@ class Test(Base):
|
||||
|
||||
CELERY_TASK_ALWAYS_EAGER = values.BooleanValue(True)
|
||||
|
||||
STORAGES = {
|
||||
"default": {
|
||||
"BACKEND": "storages.backends.s3.S3Storage",
|
||||
},
|
||||
"staticfiles": {
|
||||
"BACKEND": values.Value(
|
||||
"servestatic.storage.CompressedStaticFilesStorage",
|
||||
environ_name="STORAGES_STATICFILES_BACKEND",
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
# pylint: disable=invalid-name
|
||||
self.INSTALLED_APPS += ["drf_spectacular_sidecar"]
|
||||
|
||||
@@ -67,6 +67,7 @@ dependencies = [
|
||||
"redis<6.0.0",
|
||||
"requests==2.34.2",
|
||||
"sentry-sdk==2.66.1",
|
||||
"servestatic==4.3.3",
|
||||
"uvicorn==0.51.0",
|
||||
]
|
||||
|
||||
|
||||
Generated
+14
@@ -994,6 +994,7 @@ dependencies = [
|
||||
{ name = "redis" },
|
||||
{ name = "requests" },
|
||||
{ name = "sentry-sdk" },
|
||||
{ name = "servestatic" },
|
||||
{ name = "uvicorn" },
|
||||
]
|
||||
|
||||
@@ -1081,6 +1082,7 @@ requires-dist = [
|
||||
{ name = "responses", marker = "extra == 'dev'", specifier = "==0.26.2" },
|
||||
{ name = "ruff", marker = "extra == 'dev'", specifier = "==0.16.0" },
|
||||
{ name = "sentry-sdk", specifier = "==2.66.1" },
|
||||
{ name = "servestatic", specifier = "==4.3.3" },
|
||||
{ name = "types-requests", marker = "extra == 'dev'", specifier = "==2.33.0.20260712" },
|
||||
{ name = "uvicorn", specifier = "==0.51.0" },
|
||||
]
|
||||
@@ -2375,6 +2377,18 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/89/d3/726bd88f0eece09ddf431bea4c9191c18e7a8d070b854eb0014d447712ee/sentry_sdk-2.66.1-py3-none-any.whl", hash = "sha256:86002793161d9a95ef04bdd8d442e9bfece5d989b755f05d6360215094a7aff6", size = 505555, upload-time = "2026-07-22T12:26:52.71Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "servestatic"
|
||||
version = "4.3.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "asgiref" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/6c/6b/ccfd794c446b61a191848337dc2757219152b142879dd50ff93b0e7290a7/servestatic-4.3.3.tar.gz", hash = "sha256:87628989eed8b6594ceed052bb185593df1fb3ff2db7c0c69b05bb8b2f7393d0", size = 33426, upload-time = "2026-09-02T21:55:49.492Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ce/fb/222b40a47f1f5736728c00485758ca35ffa8535a16f75e22e1a05205f614/servestatic-4.3.3-py3-none-any.whl", hash = "sha256:d46d374eef87a48b3b55379bf693613420e186c5b823f3e8fcceeda65c0c6e30", size = 40519, upload-time = "2026-09-02T21:55:48.302Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "six"
|
||||
version = "1.17.0"
|
||||
|
||||
@@ -71,7 +71,7 @@ backend:
|
||||
AWS_S3_ACCESS_KEY_ID: dinum
|
||||
AWS_S3_SECRET_ACCESS_KEY: password
|
||||
AWS_STORAGE_BUCKET_NAME: docs-media-storage
|
||||
STORAGES_STATICFILES_BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
|
||||
STORAGES_STATICFILES_BACKEND: servestatic.storage.CompressedManifestStaticFilesStorage
|
||||
DOCSPEC_API_URL: http://impress-docs-docspec:4000/conversion
|
||||
USER_RECONCILIATION_FORM_URL: https://docs.127.0.0.1.nip.io
|
||||
Y_PROVIDER_API_BASE_URL: http://impress-docs-y-provider-converter:443/api/
|
||||
|
||||
@@ -71,7 +71,7 @@ backend:
|
||||
AWS_S3_ACCESS_KEY_ID: dinum
|
||||
AWS_S3_SECRET_ACCESS_KEY: password
|
||||
AWS_STORAGE_BUCKET_NAME: docs-media-storage
|
||||
STORAGES_STATICFILES_BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
|
||||
STORAGES_STATICFILES_BACKEND: servestatic.storage.CompressedManifestStaticFilesStorage
|
||||
DOCSPEC_API_URL: http://impress-docs-docspec:4000/conversion
|
||||
USER_RECONCILIATION_FORM_URL: https://{{ .Values.feature }}-docs.{{ .Values.domain }}
|
||||
Y_PROVIDER_API_BASE_URL: http://impress-docs-y-provider-converter:443/api/
|
||||
|
||||
Reference in New Issue
Block a user