Introduction to Tornado - Helion
ISBN: 978-14-493-3397-3
stron: 138, Format: ebook
Data wydania: 2012-03-19
Księgarnia: Helion
Cena książki: 59,42 zł (poprzednio: 69,09 zł)
Oszczędzasz: 14% (-9,67 zł)
Walk through the basics of Tornado, the high-performance web server known for its speed, simplicity, and scalability on projects large and small. With this hands-on guide, you’ll learn how to use Tornado’s acclaimed features by working with several example applications. You also get best practices for using Tornado in the real world.
Are you interested in creating a scalable social application, real-time analytics engine, or RESTful API—all with the power and simplicity of Python? This book shows you why Tornado is fantastic choice for writing powerful applications that are simple to create, extend, and deploy.
- Learn how to use Tornado’s lightweight and flexible templating language
- Extend templates to repurpose headers, footers, layout grids, and other content
- Use persistent storage like MongoDB to store, serve, and edit dynamic content
- Explore Tornado’s ability to make asynchronous web requests
- Secure your application against cookie and request vulnerabilities
- Authenticate with external services, using Tornado’s auth module
- Adopt deployment strategies that help harden your application and increase request throughput
Osoby które kupowały "Introduction to Tornado", wybierały także:
- Windows Media Center. Domowe centrum rozrywki 66,67 zł, (8,00 zł -88%)
- Ruby on Rails. Ćwiczenia 18,75 zł, (3,00 zł -84%)
- Przywództwo w świecie VUCA. Jak być skutecznym liderem w niepewnym środowisku 58,64 zł, (12,90 zł -78%)
- Scrum. O zwinnym zarządzaniu projektami. Wydanie II rozszerzone 58,64 zł, (12,90 zł -78%)
- Od hierarchii do turkusu, czyli jak zarządzać w XXI wieku 58,64 zł, (12,90 zł -78%)
Spis treści
Introduction to Tornado. Modern Web Applications with Python eBook -- spis treści
- Introduction to Tornado
- SPECIAL OFFER: Upgrade this ebook with OReilly
- Preface
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- Acknowledgements
- 1. Introduction
- What Is Tornado?
- Getting Started with Tornado
- Community and Support
- Simple Web Services
- Hello Tornado
- The handlers Parameter
- Specifying paths with regular expressions
- String Service
- More About RequestHandlers
- HTTP methods
- HTTP status codes
- Next Steps
- Hello Tornado
- What Is Tornado?
- 2. Forms and Templates
- Simple Example: Poem Maker Pro
- Rendering Templates
- Interpolation
- Template Syntax
- Interpolating Expressions
- Control Flow Statements
- Using Functions Inside Templates
- Complete Example: The Alpha Munger
- How It Works
- Serving Static Files
- Setting the static_path
- Generating static URLs with static_url
- Next Steps with Templates
- Simple Example: Poem Maker Pro
- 3. Extending Templates
- Blocks and Substitutions
- Basics of Blocks
- Templates in Practice: Burts Books
- Autoescaping
- UI Modules
- Basic Module Usage
- Modules in Depth
- Embedding JavaScript and CSS
- Summing Up
- Blocks and Substitutions
- 4. Databases
- Basic MongoDB Operations with PyMongo
- Establishing a Connection
- Dealing with Documents
- MongoDB Documents and JSON
- A Simple Persistent Web Service
- A Read-Only Dictionary
- Writing the Dictionary
- Burts Books
- Reading Books (From the Database)
- Editing and Adding Books
- Rendering the edit form
- Retrieving book information from the database
- Saving to the database
- MongoDB: Next Steps
- Basic MongoDB Operations with PyMongo
- 5. Asynchronous Web Services
- Asynchronous Web Requests
- Starting Synchronous
- The Trouble with Blocking
- Basic Asynchronous Calls
- The asynchronous Decorator and the finish Method
- Asynchronous Generators
- Summary of Asynchronous Operations
- Long Polling with Tornado
- The Benefits of Long Polling
- Example: Live Inventory Reporting
- The Downsides of Long Polling
- WebSockets with Tornado
- Tornados WebSocket Module
- Example: Live Inventory with WebSockets
- The Future of WebSockets
- Asynchronous Web Requests
- 6. Writing Secure Applications
- Cookie Vulnerabilities
- Cookie Forgery
- Secure Cookies
- Using Secure Cookies
- HTTP-Only and SSL Cookies
- Request Vulnerabilities
- Anatomy of a Cross-Site Request Forgery
- Defending Against Request Forgeries
- Using Tornados XSRF protection
- XSRF Tokens and AJAX Requests
- User Authentication
- Example: Welcome Back
- The authenticated Decorator
- The current_user property
- The login_url setting
- Summing up
- Cookie Vulnerabilities
- 7. Authenticating with External Services
- The Tornado auth Module
- The Authorization Workflow
- Asynchronous Requests
- Example: Sign in With Twitter
- Example: Facebook Authentication and the Graph API
- The Tornado auth Module
- 8. Deploying Tornado
- Reasons for Running Multiple Tornado Instances
- Using Nginx as a Reverse Proxy
- Basic Nginx Configuration
- SSL Decryption with Nginx
- Using Supervisor to Manage Tornado Processes
- About the Authors
- SPECIAL OFFER: Upgrade this ebook with OReilly