runfcgi.py 919 B

123456789101112131415161718192021222324252627
  1. import warnings
  2. from django.core.management.base import BaseCommand
  3. class Command(BaseCommand):
  4. help = "Runs this project as a FastCGI application. Requires flup."
  5. args = '[various KEY=val options, use `runfcgi help` for help]'
  6. def handle(self, *args, **options):
  7. warnings.warn(
  8. "FastCGI support has been deprecated and will be removed in Django 1.9.",
  9. PendingDeprecationWarning)
  10. from django.conf import settings
  11. from django.utils import translation
  12. # Activate the current language, because it won't get activated later.
  13. try:
  14. translation.activate(settings.LANGUAGE_CODE)
  15. except AttributeError:
  16. pass
  17. from django.core.servers.fastcgi import runfastcgi
  18. runfastcgi(args)
  19. def usage(self, subcommand):
  20. from django.core.servers.fastcgi import FASTCGI_HELP
  21. return FASTCGI_HELP