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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
django
hshassets
Commits
db34e0c6
Commit
db34e0c6
authored
7 years ago
by
Elke Kreim
Browse files
Options
Downloads
Patches
Plain Diff
Create static assets folder for apps that have no local assets folder
parent
4273ad62
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
hshassets/utils.py
+11
-1
11 additions, 1 deletion
hshassets/utils.py
with
11 additions
and
1 deletion
hshassets/utils.py
+
11
−
1
View file @
db34e0c6
...
@@ -16,6 +16,7 @@ def get_asset_directories():
...
@@ -16,6 +16,7 @@ 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
=
{}
asset_apps
=
{}
all_apps
=
{}
for
app_name
in
settings
.
INSTALLED_APPS
:
for
app_name
in
settings
.
INSTALLED_APPS
:
app_module
=
import_module
(
app_name
)
app_module
=
import_module
(
app_name
)
...
@@ -31,8 +32,17 @@ def get_asset_directories():
...
@@ -31,8 +32,17 @@ def get_asset_directories():
}
}
})
})
all_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
():
for
source_app
,
target_app
in
STATIC_TARGET_APPS
.
items
():
asset_apps
[
source_app
][
'
static_path
'
]
=
a
sset
_apps
[
target_app
][
'
static_base_path
'
]
+
source_app
asset_apps
[
source_app
][
'
static_path
'
]
=
a
ll
_apps
[
target_app
][
'
static_base_path
'
]
+
source_app
return
asset_apps
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