#19773: Include Django apps in system status view

This commit is contained in:
Jeremy Stretch
2025-08-13 09:03:16 -04:00
parent 2004ab7a0e
commit b5b0c40727
4 changed files with 60 additions and 21 deletions

17
netbox/utilities/apps.py Normal file
View File

@@ -0,0 +1,17 @@
from django.apps import apps
def get_installed_apps():
"""
Return the name and version number for each installed Django app.
"""
installed_apps = {}
for app_config in apps.get_app_configs():
app = app_config.module
if version := getattr(app, 'VERSION', getattr(app, '__version__', None)):
if type(version) is tuple:
version = '.'.join(str(n) for n in version)
installed_apps[app_config.name] = version
return {
k: v for k, v in sorted(installed_apps.items())
}