1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Expose regsitry in templates using existing context processor for settings

This commit is contained in:
Jeremy Stretch
2020-03-27 13:18:51 -04:00
parent fd6739f0cc
commit dd9fc4173d
5 changed files with 8 additions and 16 deletions

View File

@ -1,10 +1,13 @@
from django.conf import settings as django_settings
from extras.registry import registry
def settings(request):
def settings_and_registry(request):
"""
Expose Django settings in the template context. Example: {{ settings.DEBUG }}
Expose Django settings and NetBox registry stores in the template context. Example: {{ settings.DEBUG }}
"""
return {
'settings': django_settings,
'registry': registry,
}