I am extending the change_list.html and I in need of outputting a variable defined in settings.py
how do I pass that particular variable into the custom admin template context?
class MyModelAdmin(admin.ModelAdmin):
...
def changelist_view(self, request, extra_context=None):
extra_context = extra_context or {}
extra_context['some_var'] = 'This is what I want to show'
return super(MyModelAdmin, self).changelist_view(request, extra_context=extra_context)
来源:https://stackoverflow.com/questions/9220042/django-how-to-pass-custom-variables-to-context-to-use-in-custom-admin-template