+1 -1 +14
Vote on this proposal

Frameworkless Web application using Python

by Akshar Raaj (speaking)

Section
Web Development
Technical level
Beginner

Objective

Attendees will leave this session with an understanding of:

  • Basics of WSGI.
  • URL dispatching.
  • Switching between different WSGI compliant servers.

Description

We will start with a discussion of WSGI. It involves:

  • WSGI Standard
  • WSGI Server
  • WSGI Application

Our objective will be writing a web application which works with few different urls. Serving the urls require a web server. We will use a WSGI compliant server provided as part of Python standard library. And then we will interface our application with this web server.

All this will be pure Python and we will not use any framework.

Next we will add url routing to our application so that conditional statements for different urls can be removed.

We will replace default Python server with Gunicorn(a WSGI compliant web server). This will help establish that we can easily switch between web servers as long as the server is WSGI compliant, and it won't require any change to web application code.

If time permits, we can add:

  • ORM capability using SQLAlchemy.
  • Templating using jinja2.

Requirements

A machine with following installed on it:

  • Python
  • Gunicorn

It would be great having SQLAlchemy and jinja2 as well so that you can follow along in case we add ORM and templating.

Speaker bio

Akshar works at Agiliq, an app development company based in Hyderabad, India. He has been working on Python, Django and Flask for the last two years.

He writes frequently about Python and technology at http://agiliq.com/blog/author/akshar and contributes to open source at Github.