Python Web Development with Sanic, published by Packt

PacktPublishing PacktPublishing Last update: Feb 29, 2024

Python Web Development with Sanic

Python Web Development with Sanic

This is the code repository for Python Web Development with Sanic, published by Packt.

An in-depth guide for Python web developers to improve the speed and scalability of web applications

What is this book about?

Today’s developers need something more powerful and customizable when it comes to web app development. They require effective tools to build something unique to meet their specific needs, and not simply glue a bunch of things together built by others. This is where Sanic comes into the picture. Built to be unopinionated and scalable, Sanic is a next-generation Python framework and server tuned for high performance.

This book covers the following exciting features:

  • Understand the difference between WSGI, Async, and ASGI servers
  • Discover how Sanic organizes incoming data, why it does it, and how to make the most of it
  • Implement best practices for building reliable, performant, and secure web apps
  • Explore useful techniques for successfully testing and deploying a Sanic web app
  • Create effective solutions for the modern web, including task management, bot integration, and GraphQL
  • Identify security concerns and understand how to deal with them in your Sanic apps

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

@app.exception(PinkElephantError)
async def handle_pink_elephants(request: Request, exception:
Exception):

Following is what you need for this book: This book is for Python web developers who have basic to intermediate-level knowledge of how web technologies work and are looking to take their applications to the next level using the power of the Sanic framework. Working knowledge of Python web development along with frameworks such as Django and/or Flask will be helpful but is not required. A basic to intermediate-level understanding of Python 3, HTTP, RESTful API patterns, and modern development practices and tools, such as type annotations, pytest, and virtual environments will also be beneficial.

With the following software and hardware list you can run all code files present in the book (Chapter 1-11).

Software and Hardware List

Chapter Software required OS required
1-11 Sanic v21.12 LTS Windows, Mac OS X, and Linux (Any)
1-11 Python 3.8+ Windows, Mac OS X, and Linux (Any)

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Related products

Get to Know the Author

Adam Hopkins is a self-taught programmer. He started programming in high school and has been using Python and building websites for more than 25 years. He is a licensed attorney and practiced law before transitioning into software engineering as a second career. Adam is the core developer and project maintainer of Sanic, a popular asynchronous Python framework and web server. Currently, he is a software engineering manager at PacketFabric, where he leads a team building backend web services. He is passionate about open source contributions and helping other developers to grow and learn. Adam lives in his desert home in the south of Israel with his wife and five children.

Updates

2022-05-07

Update to autodiscovery.py in Chapter 2 to resolve #11 related to a difference in behaviors between Sanic v21.3 and v21.6

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781801814416

Tags:

Subscribe to our newsletter