-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge dev for closing release v0.9.1
- Loading branch information
Showing
5 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Settings file for running the demo projects with Django's development server. | ||
# | ||
# noinspection PyUnresolvedReferences | ||
from .settings import * | ||
|
||
SESSION_COOKIE_SECURE = False # Allows the sent of session cookie on http | ||
CSRF_COOKIE_SECURE = False # Allows the sent of csrf cookie on http | ||
SPID_BASE_URL = None # the base URL is got dynamically from request.build_absolute_uri('/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# | ||
# Settings file for running the demo projects with dynamic base URL setting. | ||
# Useful for running the demo with a non-local IP address. | ||
# | ||
# noinspection PyUnresolvedReferences | ||
from .settings import * | ||
|
||
SPID_BASE_URL = None # With None the base URL is got dynamically from request.build_absolute_uri('/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,56 @@ | ||
python -B ./manage.py migrate | ||
python -B ./manage.py collectstatic --noinput | ||
#!/usr/bin/env bash | ||
# | ||
# Run the demo project with uwsgi web server (https, the default) or the development server (http) | ||
# | ||
|
||
# python -B ./manage.py runserver 0.0.0.0:8000 | ||
uwsgi --http-keepalive --https 0.0.0.0:8000,./certificates/public.cert,./certificates/private.key --module example.wsgi:application --env example.settings --chdir . | ||
# Default run settings | ||
address="0.0.0.0:8000" | ||
protocol="https" | ||
|
||
# Parse cli arguments provided with -p PROTOCOL or -a ADDRESS (take the lasts) | ||
while getopts p:a: flag | ||
do | ||
case "${flag}" in | ||
p) protocol=${OPTARG};; | ||
a) address=${OPTARG};; | ||
esac | ||
done | ||
|
||
# Select and run the proper server and settings | ||
if [[ $protocol = "http" ]] | ||
then | ||
echo "Run on http with Django's development server ..." | ||
python -B ./manage.py migrate | ||
DJANGO_SETTINGS_MODULE='example.develop_settings' python -B ./manage.py runserver $address | ||
|
||
elif [[ $protocol != "https" ]] | ||
then | ||
echo -e "\033[1;31mWrong protocol '$protocol' provided (use 'https' or 'http').\033[0m" | ||
exit 1 | ||
|
||
elif [[ $address != "0.0.0.0:8000" ]] | ||
then | ||
echo "Run on https with uwsgi server and dynamic SPID_BASE_URL ..." | ||
python -B ./manage.py migrate | ||
python -B ./manage.py collectstatic --noinput | ||
|
||
DJANGO_SETTINGS_MODULE='example.dynamic_settings' uwsgi \ | ||
--http-keepalive \ | ||
--https $address,./certificates/public.cert,./certificates/private.key \ | ||
--module example.wsgi:application \ | ||
--env example.dynamic_settings \ | ||
--chdir . | ||
|
||
else | ||
echo "Run on https with uwsgi server and fixed SPID_BASE_URL ..." | ||
python -B ./manage.py migrate | ||
python -B ./manage.py collectstatic --noinput | ||
|
||
uwsgi \ | ||
--http-keepalive \ | ||
--https 0.0.0.0:8000,./certificates/public.cert,./certificates/private.key \ | ||
--module example.wsgi:application \ | ||
--env example.settings \ | ||
--chdir . | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters