Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
4f27dd43
Commit
4f27dd43
authored
Aug 10, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When in debug mode, check the staticfiles.finders before mangling urls
parent
b9459ace
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
common/djangoapps/static_replace.py
+11
-1
No files found.
common/djangoapps/static_replace.py
View file @
4f27dd43
from
staticfiles.storage
import
staticfiles_storage
from
staticfiles
import
finders
from
django.conf
import
settings
import
re
...
...
@@ -9,7 +11,15 @@ def replace(static_url, prefix=None):
prefix
=
prefix
+
'/'
quote
=
static_url
.
group
(
'quote'
)
if
staticfiles_storage
.
exists
(
static_url
.
group
(
'rest'
)):
servable
=
(
# If in debug mode, we'll serve up anything that the finders can find
(
settings
.
DEBUG
and
finders
.
find
(
static_url
.
group
(
'rest'
),
True
))
or
# Otherwise, we'll only serve up stuff that the storages can find
staticfiles_storage
.
exists
(
static_url
.
group
(
'rest'
))
)
if
servable
:
return
static_url
.
group
(
0
)
else
:
url
=
staticfiles_storage
.
url
(
prefix
+
static_url
.
group
(
'rest'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment