Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pycon SG

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Pycon SG

"Basics of WSGI" talk at Pycon SG 2015

Avatar for Akshar Raaj

Akshar Raaj

June 22, 2015

More Decks by Akshar Raaj

Other Decks in Programming

Transcript

  1. WSGI Standard • Web Server Gateway • Not code, not

    software. • Set of specifications. • Interface
  2. Server side • Not in physical sense. • Understands http.

    Like any general web server. • WSGIRequestHandler. WSGI compliant.
  3. Conditions for “application side” • Must be a callable. •

    Must accept two arguments. • Must use start_response() to notify the server.
  4. Not so basic • Add few if conditions. • Web

    frameworks have a better way to handle url routing.
  5. Using Gunicorn • Gunicorn is a WSGI compliant server. •

    pip install gunicorn. • gunicorn application:application
  6. make_server with Django • A normal Django project with “runserver”.

    • Find where the “application” callable is. • dj.wsgi.application. • Use “make_server” to start a web server.
  7. Django project • The Django project we discussed during the

    talk is on Github. • https://github.com/akshar-raaj/pyconsg
  8. About me • I work at Agiliq. • Github: https://github.com/akshar-raaj

    • Twitter: https://twitter.com/_akshar • Blog: