ocata - theme customization with templates

asked 2017-06-13 09:30:27 -0600

sigsupdev gravatar image

Hello,

I'm building Openstack Ocata Environment using RDO on CentOS 7 and I am trying to create custom theme with templates. I have created my theme folder in /usr/share/openstack-dashboard/openstack-dashboard/themes and I have registered it in local_settings.py

AVAILABLE_THEMES = [ 
 ('default','Default','themes/default'),
 ('material','Material','themes/material'),
 ('gsi','GSI','themes/gsitheme'),
]

While restarting httpd service, on command: python /usr/share/openstack-dashboard/manage.py compress; there is a problem:

Traceback (most recent call last):   File "/usr/share/openstack-dashboard/manage.py", line 23, in <module>
    execute_from_command_line(sys.argv)   File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()   File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS   File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)   File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)   File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)   File "/usr/share/openstack-dashboard/openstack_dashboard/settings.py", line 429, in <module>
    THEME_COLLECTION_DIR, ROOT_PATH)   File "/usr/share/openstack-dashboard/openstack_dashboard/utils/settings.py", line 331, in find_static_files
    (templates_part, override_path) = theme_file.split('/templates/')

My workaround is change in file /usr/share/openstack-dashboard/openstack_dashboard/utils/settings.py line (templates_part, override_path) = theme_file.split('/templates/') to

(templates_part, override_path) = theme_file.split('templates/')

and then everything works, but I am sure that there is a better way (maybe some variable?) to solve it.

Thanks for help,

Agnieszka

edit retag flag offensive close merge delete