nixpkgs/pkgs/by-name/ne/netbox_4_0/custom-static-root.patch
Minijackson 97815535fb
netbox_4_0: init at 4.0.11
Migrate to pkgs/by-name,
and update the test so that it passes for all versions

This version is added as EOL, since NetBox 4.1 is out,
but it might be still useful in case of an upgrade issue.
2024-10-23 21:07:28 +02:00

14 lines
538 B
Diff

diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py
index 2de06dd10..00406af48 100644
--- a/netbox/netbox/settings.py
+++ b/netbox/netbox/settings.py
@@ -410,7 +412,7 @@ USE_X_FORWARDED_HOST = True
X_FRAME_OPTIONS = 'SAMEORIGIN'
# Static files (CSS, JavaScript, Images)
-STATIC_ROOT = BASE_DIR + '/static'
+STATIC_ROOT = getattr(configuration, 'STATIC_ROOT', os.path.join(BASE_DIR, 'static')).rstrip('/')
STATIC_URL = f'/{BASE_PATH}static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'project-static', 'dist'),