Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Koehler
rdmo-docker-compose
Commits
8afb7b80
Commit
8afb7b80
authored
Oct 16, 2019
by
olaf michaelis
Browse files
Add modified wsgi.py to avoid corrupt urls
parent
f9f8e04a
Changes
3
Hide whitespace changes
Inline
Side-by-side
rdmo/rootfs/opt/install-rdmo.sh
View file @
8afb7b80
...
...
@@ -4,7 +4,6 @@ source /opt/ve.sh
if
[[
$(
pip freeze |
grep
-Poc
"^rdmo=="
)
==
"0"
]]
;
then
cp
-f
/tmp/wsgi.py /vol/rdmo-app/config/wsgi.py
pip
install
--upgrade
pip
pip
install
--upgrade
wheel
...
...
@@ -15,6 +14,7 @@ if [[ $(pip freeze | grep -Poc "^rdmo==") == "0" ]]; then
git clone
${
RDMO_APP_REPO
}
${
RDMO_APP
}
cp
-f
/tmp/template_local.py
${
RDMO_APP
}
/config/settings/local.py
cp
-f
/tmp/wsgi.py
${
RDMO_APP
}
/config/wsgi.py
cd
${
RDMO_APP
}
python manage.py makemigrations
...
...
rdmo/rootfs/tmp/template_local.py
View file @
8afb7b80
...
...
@@ -17,7 +17,7 @@ cryptographic signing, and should be set to a unique, unpredictable value.
SECRET_KEY
=
'this is not a very secret key'
'''
The list of URLs und which this application available
The list of URLs und
er
which this application
is
available
'''
ALLOWED_HOSTS
=
[
x
.
strip
()
for
x
in
os
.
environ
[
'ALLOWED_HOSTS'
].
split
(
','
)]
# ALLOWED_HOSTS = ['localhost', 'ip6-localhost', '127.0.0.1', '[::1]', 'rdmo']
...
...
@@ -25,7 +25,7 @@ ALLOWED_HOSTS = [x.strip() for x in os.environ['ALLOWED_HOSTS'].split(',')]
'''
The root url of your application, only needed when its not '/'
'''
#
BASE_URL =
'/path'
BASE_URL
=
os
.
environ
[
'BASE_URL'
]
'''
Language code and time zone
...
...
rdmo/rootfs/tmp/wsgi.py
View file @
8afb7b80
import
os
import
re
from
django.core.wsgi
import
get_wsgi_application
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"config.settings"
)
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'config.settings'
)
try
:
os
.
environ
[
'BASE_URL'
]
except
KeyError
:
pass
else
:
if
bool
(
re
.
search
(
'[a-z0-9]'
,
os
.
environ
[
'BASE_URL'
]))
is
False
:
os
.
environ
[
'BASE_URL'
]
=
''
application
=
get_wsgi_application
()
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment