Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hshassets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
django
hshassets
Commits
4273ad62
Commit
4273ad62
authored
7 years ago
by
Dennis Ahrens
Browse files
Options
Downloads
Patches
Plain Diff
Make target static folder configurable through settings
parent
6f241267
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
hshassets/app_settings/defaults.py
+7
-0
7 additions, 0 deletions
hshassets/app_settings/defaults.py
hshassets/utils.py
+6
-2
6 additions, 2 deletions
hshassets/utils.py
with
13 additions
and
2 deletions
hshassets/app_settings/defaults.py
+
7
−
0
View file @
4273ad62
...
...
@@ -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
=
{}
This diff is collapsed.
Click to expand it.
hshassets/utils.py
+
6
−
2
View file @
4273ad62
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment