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