wsgi.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #
  2. # SPDX-License-Identifier: GPL-2.0-only
  3. #
  4. """
  5. WSGI config for Toaster project.
  6. This module contains the WSGI application used by Django's development server
  7. and any production WSGI deployments. It should expose a module-level variable
  8. named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
  9. this application via the ``WSGI_APPLICATION`` setting.
  10. Usually you will have the standard Django WSGI application here, but it also
  11. might make sense to replace the whole Django WSGI application with a custom one
  12. that later delegates to the Django one. For example, you could introduce WSGI
  13. middleware here, or combine a Django application with an application of another
  14. framework.
  15. """
  16. import os
  17. # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
  18. # if running multiple sites in the same mod_wsgi process. To fix this, use
  19. # mod_wsgi daemon mode with each site in its own daemon process, or use
  20. # os.environ["DJANGO_SETTINGS_MODULE"] = "Toaster.settings"
  21. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toastermain.settings")
  22. # This application object is used by any WSGI server configured to use this
  23. # file. This includes Django's development server, if the WSGI_APPLICATION
  24. # setting points here.
  25. from django.core.wsgi import get_wsgi_application
  26. application = get_wsgi_application()
  27. # Apply WSGI middleware here.
  28. # from helloworld.wsgi import HelloWorldApplication
  29. # application = HelloWorldApplication(application)