Skip to content
Snippets Groups Projects
Commit 25b4e71e authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

add utility scripts

add Utils directory
add Utils README
add setup script
add check script
add update script
document usages in top-level README
parent 437e0731
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,14 @@ Python requirements are listed in ``requirements.txt``. They can be installed wi
* change into that directory ``cd AKPlanning``
* clone this repository ``git clone URL .``
**Automatic Setup**
1. execute the setup bash script ``Utils/setup.sh``
**Manual Setup**
1. setup a virtual environment using the proper python version ``virtualenv env -p python3.7``
1. activate virtualenv ``source env/bin/activate``
1. install python requirements ``pip install -r requirements.txt``
......@@ -41,7 +49,17 @@ Python requirements are listed in ``requirements.txt``. They can be installed wi
1. create a priviledged user, credentials are entered interactively on CLI ``python manage.py createsuperuser``
1. deactivate virtualenv ``deactivate``
**Development Server**
To start the application for development use ``python manage.py runserver 0:8000`` from the root directory.
*Do not use this for deployment!*
In your browser, access ``http://127.0.0.1:8000/wannaDB/`` and continue from there.
### Updates
To update the setup to the current version on the main branch of the repository use the update script ``Utils/update.sh`` or ``Utils/update.sh --prod`` in production.
Afterwards, you may check your setup by executing ``Utils/check.sh`` or ``Utils/check.sh --prod`` in production.
# AKPlanning Utility Scripts
This directory contains helper scripts for setup and updating/checking of AKPlanning.
All scripts should be executed from the project folder (repository root).
* **setup** installation script for development setup
* **update** update script for development or production (--prod) setup
* **check** setup checking script for development and production (--prod) setup
#!/usr/bin/env bash
# Check the AKPlanning setup for potential problems
# execute as Utils/check.sh
# activate virtualenv when necessary
if [ -z ${VIRTUAL_ENV+x} ]; then
source env/bin/activate
fi
# enable really all warnings, some of them are silenced by default
if [[ "$@" == *"--all"* ]]; then
export PYTHONWARNINGS=all
fi
# in case of checking production setup
if [[ "$@" == *"--prod"* ]]; then
export DJANGO_SETTINGS_MODULE=AKPlanning.settings_production
./manage.py check --deploy
fi
./manage.py check
#!/usr/bin/env bash
# Setup AKPlanning
# execute as Utils/check.sh
# abort on error, print executed commands
set -ex
# remove old virtualenv
rm -rf env/
# Setup Python Environment
# Requires: Virtualenv, appropriate Python installation
virtualenv env -p python3.7
source env/bin/activate
pip install --upgrade setuptools pip wheel
pip install -r requirements.txt
# Setup database
python manage.py migrate
# Create superuser
# Credentials are entered interactively on CLI
python manage.py createsuperuser
deactivate
#!/usr/bin/env bash
# Update AKPlanning
# execute as Utils/check.sh
# abort on error, print executed commands
set -ex
# activate virtualenv if necessary
if [ -z ${VIRTUAL_ENV+x} ]; then
source env/bin/activate
fi
# set environment variable when we want to update in production
if [ "$1" = "--prod" ]; then
export DJANGO_SETTINGS_MODULE=AKPlanning.settings_production
fi
git pull
pip install --upgrade setuptools pip wheel
pip install --upgrade -r requirements.txt
if [ "$1" = "--prod" ]; then
./manage.py collectstatic --noinput
fi
./manage.py migrate
touch AKPlanning/wsgi.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment