Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bryan BRANCOTTE
django-basetheme-bootstrap
Commits
04bc1372
Commit
04bc1372
authored
Nov 05, 2020
by
Bryan BRANCOTTE
Browse files
use absolut url on demand
parent
5c75969c
Pipeline
#40982
passed with stage
in 1 minute and 32 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
basetheme_bootstrap/templatetags/sstatic.py
View file @
04bc1372
...
...
@@ -10,13 +10,17 @@ from django.core.cache import cache
register
=
template
.
Library
()
__USE_ABSOLUT_URL_FOR_STATIC
=
getattr
(
settings
,
"USE_ABSOLUT_URL_FOR_STATIC"
,
False
)
@
register
.
simple_tag
(
takes_context
=
True
)
def
sstatic
(
context
,
path
):
url
=
cache
.
get
(
path
)
if
url
:
return
url
url
=
get_absolut_url
(
context
[
"request"
],
compute_url_for_path
(
path
))
url
=
compute_url_for_path
(
path
)
if
__USE_ABSOLUT_URL_FOR_STATIC
:
url
=
get_absolut_url
(
context
[
"request"
],
url
)
cache
.
set
(
path
,
url
,
None
)
return
url
...
...
setup.py
View file @
04bc1372
...
...
@@ -7,7 +7,7 @@ readme = open('README.rst').read()
setup
(
name
=
'django-basetheme-bootstrap'
,
version
=
'0.2.4
5
'
,
version
=
'0.2.4
6
'
,
description
=
'Django Basetheme Bootstrap'
,
long_description
=
readme
,
author
=
'Bryan Brancotte'
,
...
...
Write
Preview
Supports
Markdown
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