xref: /openbmc/openbmc/poky/bitbake/lib/toaster/toastermain/wsgi.py (revision c124f4f2e04dca16a428a76c89677328bc7bf908)
1#
2# SPDX-License-Identifier: GPL-2.0-only
3#
4
5"""
6WSGI config for Toaster project.
7
8This module contains the WSGI application used by Django's development server
9and any production WSGI deployments. It should expose a module-level variable
10named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
11this application via the ``WSGI_APPLICATION`` setting.
12
13Usually you will have the standard Django WSGI application here, but it also
14might make sense to replace the whole Django WSGI application with a custom one
15that later delegates to the Django one. For example, you could introduce WSGI
16middleware here, or combine a Django application with an application of another
17framework.
18
19"""
20import 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"
26os.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.
31from django.core.wsgi import get_wsgi_application
32application = get_wsgi_application()
33
34# Apply WSGI middleware here.
35# from helloworld.wsgi import HelloWorldApplication
36# application = HelloWorldApplication(application)
37