1. Matthew Schinckel
  2. django-deploy

Source

django-deploy / deploy / management / commands / mod_wsgi.py

from django.template.loader import render_to_string
from django.core.management.base import BaseCommand
from django.conf import settings


class Command(BaseCommand):
    args = ""
    
    def handle(self, *args, **kwargs):
        if 'staticmedia' in settings.INSTALLED_APPS:
            from staticmedia import serverconf
            aliases = serverconf.apache()
        else:
            aliases = None
        data = [
            {
                'port':'80',
                'servername':'my.rosterwithross.com',
                'installpath':'/var/www/datamine',
                'project':'rossweb',
                'ssl_cert': None,
                'staticmedia': aliases
            }
        ]
        
        for conf in data:
            print render_to_string('deploy/apache_conf/mod_wsgi.conf', conf)