UPD: so many improvements :)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
WSGIDaemonProcess django-test display-name=django-test python-home=/srv/django-test/python python-path=/srv/django-test/django
|
||||
|
||||
Alias /static/ "/srv/django-test/django/var/www/static/"
|
||||
<Directory "/srv/django-test/django/var/www/static">
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
WSGIScriptAlias / "/srv/django-test/django/main/wsgi.py"
|
||||
<Directory "/srv/django-test/django/main">
|
||||
WSGIProcessGroup django-test
|
||||
WSGIPassAuthorization On
|
||||
AllowOverride None
|
||||
Options FollowSymLinks
|
||||
<Files wsgi.py>
|
||||
Require all granted
|
||||
</Files>
|
||||
</Directory>
|
||||
45
container-files/django-test-layer/srv/bin/setup-django-test.sh
Executable file
45
container-files/django-test-layer/srv/bin/setup-django-test.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
### config ###
|
||||
PROJECT_NAME="django-test"
|
||||
SETUP_COMMAND="django-test-admin"
|
||||
|
||||
INSTALL_DIR="/srv/${PROJECT_NAME}"
|
||||
VENV_DIR="python"
|
||||
VENV_PATH="${INSTALL_DIR}/${VENV_DIR}"
|
||||
DJANGO_DIR="django"
|
||||
DJANGO_PATH="${INSTALL_DIR}/${DJANGO_DIR}"
|
||||
DJANGO_MAIN_MODULE="main"
|
||||
|
||||
PROJECT_REPO="git+https://heinzelwelt.de/vcs/python/django-test"
|
||||
|
||||
### argv ###
|
||||
if test "$1" != "" ; then
|
||||
if test "$1" != "-" ; then
|
||||
INSTALL_DIR="$1"
|
||||
fi
|
||||
shift
|
||||
fi
|
||||
if test "$1" != "" ; then
|
||||
if test "$1" != "-" ; then
|
||||
PROJECT_REPO="$1"
|
||||
fi
|
||||
shift
|
||||
fi
|
||||
|
||||
### action ###
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
python3 -m venv "${VENV_PATH}"
|
||||
source "${VENV_PATH}/bin/activate"
|
||||
pip install --upgrade pip
|
||||
pip install "$PROJECT_REPO"
|
||||
$SETUP_COMMAND setup "${DJANGO_PATH}"
|
||||
python3 "${DJANGO_PATH}/manage.py" collectstatic --noinput
|
||||
|
||||
cat <<E-O-H >> "${DJANGO_PATH}/${DJANGO_MAIN_MODULE}/settings.py"
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
DEBUG = False
|
||||
E-O-H
|
||||
|
||||
### end ###
|
||||
Reference in New Issue
Block a user