← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1271151] [NEW] Unable to include openstack_dashboard.settings in other top-level django settings module

 

Public bug reported:

In order to augment openstack_dashboard.settings with specific django
application settings (namely, Murano) while editing neither
openstack_dashboard.settings (it contains only settings related to
vanilla openstack dashboards), nor
/etc/openstack_dashoards/local_settings.py (it is for customization by
admins) the following scheme was devised.  Change DJANGO_SETTINGS_MODULE
in Apache config/WSGI python module to 'muranodashboard.settings' which
contains all Murano-specific settings and imports
openstack_dashboard.settings, which in turn imports
local.local_settings. This approach seemed fine until I coded it and
ran: it immediately failed with 'ImproperlyConfigured: The SECRET_KEY
setting must not be empty.' exception.

After spending some time in debugger, I found out that during
'openstack_dashboard.settings' module evaluation 'django.conf.Settings'
class is instantiated and it requires the 'SECRET_KEY' parameter to be
present in settings module referenced by DJANGO_SETTINGS_MODULE
environment variable (which, in my case is 'muranodashboard.settings').
But if I try to avoid this error and define my own SECRET_KEY in
'muranodashboard.settings', I end up with 2 different SECRET_KEY values
(one from muranodashboard.settings, the other hanging somewhere in
horizon's machinery from local.local_settings /
openstack_dashboard.settings) which is not good either.

This behaviour clearly seems like a bug, because
openstack_dashboard.settings shouldn't invoke functions that rely on
SECRET_KEY being already defined in DJANGO_SETTINGS_MODULE module.

** Affects: horizon
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1271151

Title:
  Unable to include openstack_dashboard.settings in other top-level
  django settings module

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  In order to augment openstack_dashboard.settings with specific django
  application settings (namely, Murano) while editing neither
  openstack_dashboard.settings (it contains only settings related to
  vanilla openstack dashboards), nor
  /etc/openstack_dashoards/local_settings.py (it is for customization by
  admins) the following scheme was devised.  Change
  DJANGO_SETTINGS_MODULE in Apache config/WSGI python module to
  'muranodashboard.settings' which contains all Murano-specific settings
  and imports openstack_dashboard.settings, which in turn imports
  local.local_settings. This approach seemed fine until I coded it and
  ran: it immediately failed with 'ImproperlyConfigured: The SECRET_KEY
  setting must not be empty.' exception.

  After spending some time in debugger, I found out that during
  'openstack_dashboard.settings' module evaluation
  'django.conf.Settings' class is instantiated and it requires the
  'SECRET_KEY' parameter to be present in settings module referenced by
  DJANGO_SETTINGS_MODULE environment variable (which, in my case is
  'muranodashboard.settings'). But if I try to avoid this error and
  define my own SECRET_KEY in 'muranodashboard.settings', I end up with
  2 different SECRET_KEY values (one from muranodashboard.settings, the
  other hanging somewhere in horizon's machinery from
  local.local_settings / openstack_dashboard.settings) which is not good
  either.

  This behaviour clearly seems like a bug, because
  openstack_dashboard.settings shouldn't invoke functions that rely on
  SECRET_KEY being already defined in DJANGO_SETTINGS_MODULE module.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1271151/+subscriptions


Follow ups

References