Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Nuovo sito
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Nuovo sito
Commits
21ce085c
Commit
21ce085c
authored
Dec 20, 2015
by
Pietro Albini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always put /+assets in the cache
parent
f1b74f6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
uitwww/__main__.py
uitwww/__main__.py
+18
-1
No files found.
uitwww/__main__.py
View file @
21ce085c
...
@@ -41,6 +41,23 @@ def run(cache, gunicorn_config, port, public, workers, debug):
...
@@ -41,6 +41,23 @@ def run(cache, gunicorn_config, port, public, workers, debug):
app
=
uitwww
.
create_app
(
cache
)
app
=
uitwww
.
create_app
(
cache
)
app
.
wsgi_app
=
utils
.
ReverseProxied
(
app
.
wsgi_app
)
app
.
wsgi_app
=
utils
.
ReverseProxied
(
app
.
wsgi_app
)
src_directory
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
# Link static assets to the cache directory, if it's enabled
static_dirs
=
{
"static"
:
"+assets"
}
if
cache
is
not
None
:
if
not
os
.
path
.
exists
(
cache
):
os
.
makedirs
(
cache
)
for
src
,
dest
in
static_dirs
.
items
():
dest
=
os
.
path
.
join
(
cache
,
dest
)
# The destinationa already exists
if
os
.
path
.
exists
(
dest
):
continue
os
.
symlink
(
os
.
path
.
join
(
src_directory
,
src
),
dest
)
host
=
"127.0.0.1"
host
=
"127.0.0.1"
if
public
:
if
public
:
host
=
"0.0.0.0"
host
=
"0.0.0.0"
...
@@ -48,7 +65,7 @@ def run(cache, gunicorn_config, port, public, workers, debug):
...
@@ -48,7 +65,7 @@ def run(cache, gunicorn_config, port, public, workers, debug):
# In debug mode, run the flask builtin webserver
# In debug mode, run the flask builtin webserver
if
debug
:
if
debug
:
extra_files
=
[
extra_files
=
[
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
)
,
"navbar.json"
),
os
.
path
.
join
(
src_directory
,
"navbar.json"
),
]
]
app
.
run
(
debug
=
True
,
port
=
port
,
host
=
host
,
extra_files
=
extra_files
)
app
.
run
(
debug
=
True
,
port
=
port
,
host
=
host
,
extra_files
=
extra_files
)
...
...
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