Sanic is a Python web framework built on uvloop and designed for fast HTTP responses via asynchronous request handling.

Sanic web framework logo.

What are the tradeoffs of using Sanic?

Sanic cannot be developed or deployed on Windows due to its necessary uvloop dependency.

Sanic is an implementation of the web framework concept. Learn how these parts fit together in the web development chapter or view all topics.

There was an excellent discussion on the /r/python subreddit about using one of the newer async frameworks such as Sanic or Japronto compared with a traditional web framework like Django. One of the major tradeoff of adopting a newer framework is simply that the code library ecosystem has not, and may never, grow up around that framework. You have to accept the risk that you will need to build a significant amount of the plumbing yourself rather than pip installing existing, well-tested libraries.

Sanic tutorials

Sanic is under very active development and is still in its infancy as a web framework. The following tutorials will get you started but there is a chance you will have to work through errors as Sanic is regularly updated.

More on web frameworks or move to deployment?

I want to learn how to code a Python web application using a framework.

What is the Django web framework?

I've built a Python web app, now how do I deploy it?

Sign up here to receive a monthly email with major updates to this site, tutorials and discount codes for Python books.

Matt Makai 2012-2017