wsgi.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Copyright 2013-2016 The Distro Tracker Developers
  2. # See the COPYRIGHT file at the top-level directory of this distribution and
  3. # at http://deb.li/DTAuthors
  4. #
  5. # This file is part of Distro Tracker. It is subject to the license terms
  6. # in the LICENSE file found in the top-level directory of this
  7. # distribution and at http://deb.li/DTLicense. No part of Distro Tracker,
  8. # including this file, may be copied, modified, propagated, or distributed
  9. # except according to the terms contained in the LICENSE file.
  10. """
  11. WSGI config for pts project.
  12. This module contains the WSGI application used by Django's development server
  13. and any production WSGI deployments. It should expose a module-level variable
  14. named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
  15. this application via the ``WSGI_APPLICATION`` setting.
  16. Usually you will have the standard Django WSGI application here, but it also
  17. might make sense to replace the whole Django WSGI application with a custom one
  18. that later delegates to the Django one. For example, you could introduce WSGI
  19. middleware here, or combine a Django application with an application of another
  20. framework.
  21. """
  22. import os
  23. from django.core.wsgi import get_wsgi_application
  24. # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
  25. # if running multiple sites in the same mod_wsgi process. To fix this, use
  26. # mod_wsgi daemon mode with each site in its own daemon process, or use
  27. # os.environ["DJANGO_SETTINGS_MODULE"] = "distro_tracker.settings"
  28. os.environ.setdefault("DJANGO_SETTINGS_MODULE",
  29. "distro_tracker.project.settings")
  30. # This application object is used by any WSGI server configured to use this
  31. # file. This includes Django's development server, if the WSGI_APPLICATION
  32. # setting points here.
  33. application = get_wsgi_application()
  34. # Apply WSGI middleware here.
  35. # from helloworld.wsgi import HelloWorldApplication
  36. # application = HelloWorldApplication(application)