Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
1d59adf6
Commit
1d59adf6
authored
Apr 07, 2017
by
Andreas Valder
Browse files
always show git commit
parent
87eba101
Changes
1
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
1d59adf6
...
...
@@ -54,9 +54,10 @@ if sys.argv[0].endswith('run.py'):
config
.
from_pyfile
(
'config.py'
,
silent
=
True
)
if
config
[
'DEBUG'
]:
app
.
jinja_env
.
auto_reload
=
True
# get git commit
import
subprocess
app
.
jinja_env
.
globals
[
'gitversion'
]
=
subprocess
.
check_output
([
'git'
,
"log"
,
"-g"
,
"-1"
,
"--pretty=%h # %d # %s"
]).
decode
(
'UTF-8'
).
split
(
'#'
)
# get git commit
import
subprocess
app
.
jinja_env
.
globals
[
'gitversion'
]
=
subprocess
.
check_output
([
'git'
,
"log"
,
"-g"
,
"-1"
,
"--pretty=%h # %d # %s"
]).
decode
(
'UTF-8'
).
split
(
'#'
)
if
not
config
.
get
(
'SECRET_KEY'
,
None
):
config
[
'SECRET_KEY'
]
=
os
.
urandom
(
24
)
...
...
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