1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
netbox-community-netbox/netbox/netbox/context_processors.py
2022-11-02 15:25:22 -04:00

17 lines
493 B
Python

from django.conf import settings as django_settings
from netbox.config import get_config
from netbox.registry import registry
def settings_and_registry(request):
"""
Expose Django settings and NetBox registry stores in the template context. Example: {{ settings.DEBUG }}
"""
return {
'settings': django_settings,
'config': get_config(),
'registry': registry,
'preferences': request.user.config if request.user.is_authenticated else {},
}