So I'm trying this:
import my_project.settings
DEVOPS_APPS = [ app for app in my_project.settings.INSTALLED_APPS if not "django" in app ]
Sometimes when I refresh, the data doesn't show.
Other times when I refresh, the data shows.
Still some other times when I refresh, I get the full list of INSTALLED_APPS
My index function looks like so:
template = loader.get_template('dashboard/index.html')
context = {
'title': "Telematics DevOps Automation Team",
'installed_apps': DEVOPS_APPS,
'server': 'atllvasbap001i.hughestelematics.net',
'charts': data['charts']
}
return HttpResponse(template.render(context))
What am I doing wrong?
When using settings, django recommends importing
django.conf.settings
instead of importing your settings module:A recommended read on this is Using settings in Python code.