· Jul 8 3m read

WSGI Support Introduction



The Web Server Gateway Interface (WSGI) is a simple calling convention for web servers to forward requests to web applications or frameworks written in the Python programming language. WSGI is a Python standard described in detail in PEP 3333.

🤔 Ok, great definition and what the point with iris ?

IRIS 2024.2+ has a new feature that allows you to run WSGI applications directly on IRIS. This feature is a great way to integrate IRIS with other Python frameworks and libraries.

This goes in the trend of Python first experience, where you can use Python to interact with IRIS, and now you can also run Python applications directly on IRIS.

How to use it

To instantiate a WSGI application on IRIS, you need to configure it in the Security->Applications->Web Applications section of the IRIS Management Portal.

Simple flask example:

File called in /irisdev/app/community directory:

from flask import Flask

app = Flask(__name__)

def hello_world():
    return 'Hello, World!'

UI Configuration


In this section, you can configure the WSGI application by providing :

  • Aplication Name

    • this corresponds of the file name of the WSGI application
    • ex: but without the .py extension : app
  • Callable Name

    • the callable function that will be called by the WSGI server
    • ex: app corresponds to the app variable in the file

    • app = Flask(__name__)

  • WSGI App directory
    • the path where the WSGI application is located
    • ex: /irisdev/app/community
  • Python Protocol Type
    • it can be wsgi or asgi
    • wsgi is the default value and the one used in this example
    • asgi is for asynchronous applications
      • we support asgi syncrhonously for now with the a2wsgi adapter
    • if checked, the WSGI application will run in debug mode
    • this is useful for development purposes as any changes to the WSGI application will be automatically reloaded

CPF Merge

You can also configure the WSGI application using CPF. Here is an example of the configuration:


Log Files

The WSGI application logs are stored in the WSGI.log file located in the mgr directory of the instance.


Here are some examples of WSGI applications that you can run on IRIS, they aim to show how to run different Python frameworks on IRIS.

Basically, the use case will be the same for all the frameworks:


  • /iris - Returns a JSON object with the top 10 classes present in the IRISAPP namespace.
  • /interop - A ping endpoint to test the interoperability framework of IRIS.
  • /posts - A simple CRUD endpoint for a Post object.
  • /comments - A simple CRUD endpoint for a Comment object.

Object Model

Post object:

  • id
  • title
  • content

Comment object:

  • id
  • post_id (foreign key to Post)
  • content





  • The ASGI is supported synchronously for now with the a2wsgi adapter.
  • tornado applications ( jupyter, streamlit, .. ) are not supported as they are not WSGI compliant.
Discussion (0)1
Log in or sign up to continue