Allow STATIC_URL override

When the change was committed to allow moving WEBROOT from '/',
STATIC_URL became hard-coded based on WEBROOT. This is an unnecessary
linking and breaks downstream packages.

This patch supports overriding STATIC_URL in local_settings.py and have
it honored by settings.py.

Closes-Bug: #1474551
Change-Id: Id0c5b2c6e4ff5f85ec94c5f474382664b303be23
This commit is contained in:
David Lyle 2015-07-21 11:16:22 -06:00
parent ede7402604
commit 3dcad99e71

View File

@ -47,6 +47,7 @@ LOGIN_URL = None
LOGOUT_URL = None
LOGIN_REDIRECT_URL = None
STATIC_ROOT = None
STATIC_URL = None
ROOT_URLCONF = 'openstack_dashboard.urls'
@ -282,8 +283,10 @@ MEDIA_URL = WEBROOT + 'media/'
if STATIC_ROOT is None:
STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static'))
STATIC_URL = WEBROOT + 'static/'
STATICFILES_DIRS = get_staticfiles_dirs(WEBROOT)
if STATIC_URL is None:
STATIC_URL = WEBROOT + 'static/'
STATICFILES_DIRS = get_staticfiles_dirs(STATIC_URL)
CUSTOM_THEME = os.path.join(ROOT_PATH, CUSTOM_THEME_PATH)