From: zuber Date: Fri, 16 Oct 2009 09:06:23 +0000 (+0200) Subject: Merge branch 'master' of stigma.nowoczesnapolska.org.pl:platforma X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/cf265108541da0a0f54e2b4517ce9441e8ccf795?hp=dbd31e1486a3f2a94cb6828ee5ceb7dee783091f Merge branch 'master' of stigma.nowoczesnapolska.org.pl:platforma --- diff --git a/fabfile.py b/fabfile.py index 1180e6f2..5a9d4040 100644 --- a/fabfile.py +++ b/fabfile.py @@ -16,7 +16,7 @@ env.use_south = False def staging(): """Use staging server""" env.hosts = ['stigma.nowoczesnapolska.org.pl:2222'] - env.user = 'zuber' + env.user = 'platforma' env.path = '/var/services/platforma' env.python = '/usr/bin/python' env.virtualenv = '/usr/bin/virtualenv' diff --git a/platforma.vhost.template b/platforma.vhost.template new file mode 100644 index 00000000..959b1645 --- /dev/null +++ b/platforma.vhost.template @@ -0,0 +1,38 @@ + + ServerName %(project_name)s.example.com + ServerAdmin admin@example.com + + WSGIDaemonProcess %(project_name)s user=%(user)s group=%(user)s processes=2 threads=15 display-name=%%{GROUP} python-path=%(path)s/lib/python2.5/site-packages + WSGIProcessGroup %(project_name)s + + WSGIScriptAlias / %(path)s/%(project_name)s.wsgi + + Order allow, deny + allow from all + + + Alias /media %(path)s/media + + Options Indexes + Order allow, deny + Allow from all + + + Alias /admin-media %(path)s/admin-media + + Options Indexes + Order allow, deny + Allow from all + + + Alias /static %(path)s/releases/current/%(project_name)s/static + + Options Indexes + Order allow, deny + Allow from all + + + LogLevel warn + ErrorLog /var/log/apache2/error.log + CustomLog /var/log/apache2/access.log combined + diff --git a/platforma.wsgi.template b/platforma.wsgi.template new file mode 100644 index 00000000..76e39032 --- /dev/null +++ b/platforma.wsgi.template @@ -0,0 +1,25 @@ +#!%(python)s +import site +site.addsitedir('%(path)s/lib/python2.5/site-packages') + +import os +from os.path import abspath, dirname, join +import sys + +# Redirect sys.stdout to sys.stderr for bad libraries like geopy that use +# print statements for optional import exceptions. +sys.stdout = sys.stderr + +# Add apps and lib directories to PYTHONPATH +sys.path = [ + '%(path)s/releases/current/%(project_name)s', + '%(path)s/releases/current', + '%(path)s/releases/current/apps', + '%(path)s/releases/current/lib', +] + sys.path + +# Run Django +os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' + +from django.core.handlers.wsgi import WSGIHandler +application = WSGIHandler()