← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1191748] Re: Cannot run flake8 because django settings are not configured

 

** Changed in: horizon
       Status: Fix Committed => Fix Released

-- 
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/1191748

Title:
  Cannot run flake8 because django settings are not configured

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  After commit cea720e7937775 (Sort imports alphabetically), flake8 outputs the following messages below.
  It happens with Django 1.5 series.

  Even when the following errors are output, flake8 seems to be done as expected.
  flake8 fails as expected when I enabled some checks currently ignored in tox.ini.
  Thus it is not critical but it makes it harder to check the flake8 warnings.

  Traceback (most recent call last):
    File "/opt/stack/horizon/.tox/pep8/local/lib/python2.7/site-packages/hacking/core.py", line 279, in is_module_for_sure
      __import__(mod)
    File "/opt/stack/horizon/.tox/pep8/local/lib/python2.7/site-packages/horizon/tabs/__init__.py", line 17, in <module>
      from horizon.tabs.base import Tab
    File "/opt/stack/horizon/.tox/pep8/local/lib/python2.7/site-packages/horizon/tabs/base.py", line 23, in <module>
      from horizon import exceptions
    File "/opt/stack/horizon/.tox/pep8/local/lib/python2.7/site-packages/horizon/exceptions.py", line 198, in <module>
      UNAUTHORIZED = tuple(HORIZON_CONFIG['exceptions']['unauthorized'])
    File "/opt/stack/horizon/.tox/pep8/local/lib/python2.7/site-packages/horizon/conf/__init__.py", line 32, in __getitem__
      self._setup(name)
    File "/opt/stack/horizon/.tox/pep8/local/lib/python2.7/site-packages/horizon/conf/__init__.py", line 10, in _setup
      from horizon.conf.default import HORIZON_CONFIG as DEFAULT_CONFIG
    File "/opt/stack/horizon/.tox/pep8/local/lib/python2.7/site-packages/horizon/conf/default.py", line 13, in <module>
      'user_home': settings.LOGIN_REDIRECT_URL,
    File "/opt/stack/horizon/.tox/pep8/local/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
      self._setup(name)
    File "/opt/stack/horizon/.tox/pep8/local/lib/python2.7/site-packages/django/conf/__init__.py", line 46, in _setup
      % (desc, ENVIRONMENT_VARIABLE))
  ImproperlyConfigured: Requested setting LOGIN_REDIRECT_URL, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

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