I’m in week three of my internship. Three weeks of long slogs, new friends, deep befuddlement and profound clarity.
And after three weeks, I want to explain to you, (and me) what a WSGI is.
I first heard of a WSGI a week and a half ago. It was after I asked my boss, ‘hey, what framework do you recommend using?’ and he replied, ‘oh, we tend to stay away from frameworks. I sent you a WSGI script. Use that.’
And then my inner voice said ‘we stay…away…from….frame..wha-huuuht? …h-how? How do? WsGWHAT….model…how…SGI…’ and then I passed out.
After I regained consciousness, I tasked myself with figuring out what in the H a WSGI is. Here’s the bare minimum you need to know, in 5 points or less, making one of the points whiskey. (You’ll see)
- WSGI is a spec that standardizes the way for web servers and Python web applications and frameworks to interface (talk to each other). In the olden days of the Wild West of the internet, some Python apps couldn’t talk to servers where other’s could. So WSGI was created to standardize rules of engagement between the two.
- It deals with, at a minimum, two things: a set of rules for talking to a web server, and a set of rules for talking to an application.
- You can also create your own middleware with a WSGI, which is usually written in Python, utilizing both the server and the application sides of the API.
- It ‘sits’ between the Python web application and the web server.
5. It is pronounced, you guessed it…
Here are some great resources for WSGI (tutorials and further reading:
Basics of WSGI
In this post we will write a web app which will serve few urls. We will not use any Python framework for it. It's only…
Learn about WSGI - WSGI.org
test.wsgi a WSGI test app showing whether your WSGI environment is working (and also outputs some interesting…
and, I’m not kidding, Wikipedia really knows what’s up with their entry on WSGIs
Web Server Gateway Interface
The Web Server Gateway Interface ( WSGI, pronounced whiskey) is a simple calling convention for web servers to forward…
Alright, happy coding!