Skip to content
Snippets Groups Projects
Tom Teichler's avatar
Tom Teichler authored
5fe3ab86
History

Website of Teckids e.V.

This repository contains the Django application for the website of Teckids e.V. It does not contain the website content itself, which is managed by Django CMS in its database.

How to deploy

The packages needed to deploy the website on Debian are:

  • python3
  • virtualenv
  • build-essential

Then, something like the following will do:

mkdir -p /srv/www/teckids-website/data/{static,media}
virtualenv -p python3 --system-site-packages /srv/www/teckids-website/venv

Make sure to place all secret configu variables in /etc/teckids/website.conf. Then, continue with the Updating section.

Updating

The following should update the website backend code:

. /srv/www/teckids-website/venv/bin/activate
pip install -r https://edugit.org/Teckids/teckids-website/raw/master/requirements.txt
pip install --upgrade git+https://edugit.org/Teckids/teckids-website
DJANGO_SETTINGS_MODULE=teckids_website.settings django-admin migrate
DJANGO_SETTINGS_MODULE=teckids_website.settings django-admin collectstatic --noinput
DJANGO_SETTINGS_MODULE=teckids_website.settings django-admin update_public_suffix_list
deactivate
chown -R www-data:www-data /srv/www/teckids-website
service apache2 restart

Configuring Apache

This is the relevant Apache config snippet:

WSGIScriptAlias / /srv/www/teckids-website/venv/lib/python2.7/site-packages/teckids_website/wsgi.py
WSGIDaemonProcess www.teckids.org python-home=/srv/www/teckids-website/venv
WSGIProcessGroup www.teckids.org
Alias /robots.txt /srv/www/teckids-website/data/static/robots.txt
Alias /favicon.ico /srv/www/teckids-website/data/static/favicon.ico
Alias /media/ /srv/www/teckids-website/data/media/
Alias /static/ /srv/www/teckids-website/data/static/
<Directory /srv/www/teckids-website/venv/lib/python2.7/site-packages/teckids_website>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>
<Directory /srv/www/teckids-website/data/media>
    Require all granted
</Directory>
<Directory /srv/www/teckids-website/data/static>
    Require all granted
</Directory>