import config
import steam
steam.set_api_key(config.api_key)
from optf2.backend import openid
from optf2.frontend import render
openid.set_session(render.session)
import web

if config.enable_fastcgi:
    web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)

if __name__ == "__main__":
    render.application.run()

import config
import steam
steam.set_api_key(config.api_key)
from optf2.backend import openid
from optf2.frontend import render
openid.set_session(render.session)
import web

# wsgi
application = render.application.wsgifunc()

if config.enable_fastcgi:
    web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)

if __name__ == "__main__":
    render.application.run()

Add wsgi handler by default
Add wsgi handler by default

  import config
  import steam
  steam.set_api_key(config.api_key)
  from optf2.backend import openid
  from optf2.frontend import render
  openid.set_session(render.session)
  import web
  
+ # wsgi
+ application = render.application.wsgifunc()
+ 
  if config.enable_fastcgi:
      web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
  
  if __name__ == "__main__":
      render.application.run()
  
Add wsgi handler by default
## Code Before:
import config
import steam
steam.set_api_key(config.api_key)
from optf2.backend import openid
from optf2.frontend import render
openid.set_session(render.session)
import web

if config.enable_fastcgi:
    web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)

if __name__ == "__main__":
    render.application.run()

## Instruction:
Add wsgi handler by default
## Code After:
import config
import steam
steam.set_api_key(config.api_key)
from optf2.backend import openid
from optf2.frontend import render
openid.set_session(render.session)
import web

# wsgi
application = render.application.wsgifunc()

if config.enable_fastcgi:
    web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)

if __name__ == "__main__":
    render.application.run()
