Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 732e0dfd55
Fetching contributors…

Cannot retrieve contributors at this time

executable file 62 lines (44 sloc) 1.572 kb
# makes an apache vhost config file based on
import sys, os
from distutils.sysconfig import get_python_lib
import settings
# slug - the string used for user, database, config name, site name, etc.
# slug = os.path.split(settings.PROJECT_ROOT)[-1]
slug = settings.DATABASES['default']['NAME']
project_root = settings.PROJECT_ROOT
static_root = settings.STATIC_ROOT
static_url = settings.STATIC_URL
site_packages = get_python_lib()
vhost = """
# /etc/apache2/sites-available/%(slug)s.conf
<VirtualHost *:80>
ServerName %(slug)s
ServerAlias www.%(slug) %(slug)
ServerRoot /home/%(slug)s/
CustomLog %(slug)s_access.log common
ErrorLog %(slug)s_error.log
# WSGIDaemonProcess %(slug)s user=%(slug)s python-path=/home/%(slug)s/.local/lib/python2.5/site-packages/
WSGIDaemonProcess %(slug)s user=%(slug)s python-path=%(site_packages)s
WSGIProcessGroup %(slug)s
# Pinax 0.9a1 uses pinax.wsgi, a2 uses
WSGIScriptAlias / %(project_root)s/deploy/pinax.wsgi
# WSGIScriptAlias / %(project_root)s/deploy/
Alias %(static_url)s %(static_root)s
<Directory %(static_root)s>
Order deny,allow
Allow from all
Options FollowSymLinks Indexes SymLinksIfOwnerMatch
print vhost % locals()
# add this for debugging, not for production
<Location /server-info>
SetHandler server-info
allow from all
Jump to Line
Something went wrong with that request. Please try again.