Skip to content
Snippets Groups Projects
Commit 4273ad62 authored by Dennis Ahrens's avatar Dennis Ahrens
Browse files

Make target static folder configurable through settings

parent 6f241267
Branches
No related tags found
No related merge requests found
......@@ -28,3 +28,10 @@ SCSS_INCLUDE_PATHS = [
# URI to the live service.it portal
SERVICE_IT_URI = 'https://service.it.hs-hannover.de/'
# THIS IS STILL EXPERIMENTAL.
# {'hshassets': 'myprojectsapp'}
# This way you say: when you render your assets from within my project (where this setting is located)
# Put the results from the assets in app KEY (hshassets) into the static folder of VALUE (myprojectapp)
# as a result you'll find myprojectapp/static/hshassets/ full of compiled assets from hshassets.
STATIC_TARGET_APPS = {}
from django.conf import settings
from hshassets import logger
from hshassets.app_settings import COLOR_SCHEME, SCSS_INCLUDE_PATHS
from hshassets.app_settings import COLOR_SCHEME, SCSS_INCLUDE_PATHS, STATIC_TARGET_APPS
from importlib import import_module
......@@ -13,7 +13,7 @@ import shutil
def get_asset_directories():
''' get every app path that contains an "asset" folder on its root '''
"""get every app path that contains an "asset" folder on its root"""
asset_apps = {}
......@@ -25,11 +25,15 @@ def get_asset_directories():
asset_apps.update({
app_name: {
'app_path': app_path,
'static_base_path': app_path + '/static/',
'static_path': app_path + '/static/' + app_name,
'asset_path': app_path + '/assets'
}
})
for source_app, target_app in STATIC_TARGET_APPS.items():
asset_apps[source_app]['static_path'] = asset_apps[target_app]['static_base_path'] + source_app
return asset_apps
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment