25 captures
20 Mar 2017 - 04 Dec 2025
May JUN Jul
07
2021 2022 2023
success
fail

About this capture

COLLECTED BY

Collection: Save Page Now Outlinks

TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20220607173701/https://www.fullstackpython.com/sanic.html
 

Full Stack Python
All topics | Blog | Supporter's Edition | @fullstackpython | Facebook | What's new?

Sanic






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.



Getting started with Sanic: the asynchronous, uvloop based web framework for Python 3.5+ is a "Hello, World!" style post for the framework and also shows how to respond to SMS text messages using Twilio.



Fixing bugs and handling 186k requests/second using Python is a fun benchmarking exercise that a developer ran when testing out Sanic on a Digital Ocean droplet.



Exploring Asyncio - uvloop, sanic and motor explains why asyncio is important to the Python community and how uvloop & sanic fit into the bigger picture.



Python Sanic Tutorial is a video tutorial on how to write your first Sanic web apps.



A Guide to Instrumenting Sanic Applications, Part 1 shows how to add Prometheus-based monitoring to Sanic applications.


Sanic open source projects and examples


There are not many example applications and extensions for Sanic compared to Flask, Djangoorother web frameworks because Sanic is still so new. However, there are some initial projects that are useful for figuring out how to build your first applications with this framework.



Gutenberg-HTTP is a web application and API built with Sanic. It's a solid clean example of how to build a decent-sized project with Sanic. There is even a demo that was deployed to Azure to show how it works.



Practical Log Viewers with Sanic and Elasticsearch - Designing CI/CD Systems shows how to build a log viewer using Sanic that collects data from various Docker containers being created through a build system.



Sanic comes with a slew of examples in the official repository.



Sanic starter bundles Sanic with SQLAlchemy and Alembic (for data migrations) as a starter project.



Sanic-limiter is an extension for rate-limiting the number of requests from a single user on Sanic APIs.



Sanic-GraphQL adds GraphQL support to a Sanic web application.



Sanic OpenAPI provides a user interface for Sanic APIs.



This Sanic & Nginx & docker-compose example has boilerplate code for setting up a Sanic project using Docker and Nginx.



Sanic JWT (source code) adds support for authentication via JSON Web Tokens (JWT). 


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?
 







Table of Contents



1. Introduction 2. Development Environments 3. Data 4. Web Development Web Frameworks Django Flask Bottle Pyramid TurboGears Falcon Morepath Sanic Other Web Frameworks Template Engines Jinja2 Mako Django Templates Web Design HTML Cascading Style Sheets (CSS) Responsive Design Minification CSS Frameworks Bootstrap Foundation JavaScript React Vue.js Angular Task Queues Celery Redis Queue (RQ) Dramatiq Static Site Generators Pelican Lektor MkDocs Testing Unit Testing Integration Testing Debugging Code Metrics Networking HTTPS WebSockets WebRTC Web APIs Microservices Webhooks Bots API Creation API Frameworks Django REST Framework API Integration Twilio Stripe Slack Okta Security SQL Injection CSRF 5. Deployment 6. DevOps Changelog What Full Stack Means About the Author Future Directions Page Statuses ...or view the full table of contents.



Full Stack Python


Full Stack Python is an open book that explains concepts in plain language and provides helpful resources for those topics.

Updates via Twitter & Facebook.



Chapters



1. Introduction 2. Development Environments 3. Data 4. Web Development » Sanic 5. Deployment 6. DevOps Changelog What Full Stack Means About the Author Future Directions Page Statuses ...or view the full table of contents.

 



Matt Makai 2012-2022