web/lib/django/core/management/commands/runfcgi.py
author ymh <ymh.work@gmail.com>
Fri, 29 Jan 2010 05:14:15 +0100
changeset 17 dc40652282ad
parent 0 0d40e90630ef
permissions -rw-r--r--
Added tag V00.06 for changeset 146d86480e85

from django.core.management.base import BaseCommand

class Command(BaseCommand):
    help = "Runs this project as a FastCGI application. Requires flup."
    args = '[various KEY=val options, use `runfcgi help` for help]'

    def handle(self, *args, **options):
        from django.conf import settings
        from django.utils import translation
        # Activate the current language, because it won't get activated later.
        try:
            translation.activate(settings.LANGUAGE_CODE)
        except AttributeError:
            pass
        from django.core.servers.fastcgi import runfastcgi
        runfastcgi(args)
        
    def usage(self, subcommand):
        from django.core.servers.fastcgi import FASTCGI_HELP
        return FASTCGI_HELP