وبلاگ بلیان

Flask Web Development: Developing Advanced Web Applications With Python

معرفی کتاب «Flask Web Development: Developing Advanced Web Applications With Python» نوشتهٔ Grinberg, Miguel، منتشرشده توسط نشر O'Reilly Media در سال 2014. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Flask Web Development: Developing Advanced Web Applications With Python» در دستهٔ بدون دسته‌بندی قرار دارد.

Take full creative control of your web applications with Flask, the Python-based microframework. With this hands-on book, you’ll learn Flask from the ground up by developing a complete social blogging application step-by-step. Author Miguel Grinberg walks you through the framework’s core functionality, and shows you how to extend applications with advanced web techniques such as database migration and web service communication. Rather than impose development guidelines as other frameworks do, Flask leaves the business of extensions up to you. If you have Python experience, this book shows you how to take advantage of that creative freedom. - Learn Flask’s basic application structure and write an example app - Work with must-have components—templates, databases, web forms, and email support - Use packages and modules to structure a large application that scales - Implement user authentication, roles, and profiles - Build a blogging feature by reusing templates, paginating item lists, and working with rich text - Use a Flask-based RESTful API to expose app functionality to smartphones, tablets, and other third-party clients - Learn how to run unit tests and enhance application performance - Explore options for deploying your web app to a production server Copyright......Page 4 Table of Contents......Page 7 Preface......Page 13 How This Book Is Organized......Page 14 How to Work with the Example Code......Page 15 Conventions Used in This Book......Page 17 Safari® Books Online......Page 18 Acknowledgments......Page 19 Part I. Introduction to Flask......Page 21 Chapter 1. Installation......Page 23 Using Virtual Environments......Page 24 Installing Python Packages with pip......Page 26 Initialization......Page 27 Routes and View Functions......Page 28 A Complete Application......Page 29 Application and Request Contexts......Page 32 Request Hooks......Page 34 Responses......Page 35 Flask Extensions......Page 36 Command-Line Options with Flask-Script......Page 37 Chapter 3. Templates......Page 41 Rendering Templates......Page 42 Variables......Page 43 Control Structures......Page 44 Twitter Bootstrap Integration with Flask-Bootstrap......Page 46 Custom Error Pages......Page 49 Links......Page 51 Static Files......Page 52 Localization of Dates and Times with Flask-Moment......Page 53 Cross-Site Request Forgery (CSRF) Protection......Page 57 Form Classes......Page 58 HTML Rendering of Forms......Page 60 Form Handling in View Functions......Page 61 Redirects and User Sessions......Page 64 Message Flashing......Page 66 SQL Databases......Page 69 NoSQL Databases......Page 70 Python Database Frameworks......Page 71 Database Management with Flask-SQLAlchemy......Page 72 Model Definition......Page 74 Relationships......Page 76 Database Operations......Page 77 Inserting Rows......Page 78 Querying Rows......Page 80 Database Use in View Functions......Page 82 Integration with the Python Shell......Page 83 Creating a Migration Repository......Page 84 Creating a Migration Script......Page 85 Upgrading the Database......Page 86 Email Support with Flask-Mail......Page 89 Sending Email from the Python Shell......Page 90 Integrating Emails with the Application......Page 91 Sending Asynchronous Email......Page 92 Project Structure......Page 95 Configuration Options......Page 96 Using an Application Factory......Page 98 Implementing Application Functionality in a Blueprint......Page 99 Launch Script......Page 101 Requirements File......Page 102 Unit Tests......Page 103 Database Setup......Page 105 Part II. Example: A Social Blogging Application......Page 107 Authentication Extensions for Flask......Page 109 Hashing Passwords with Werkzeug......Page 110 Creating an Authentication Blueprint......Page 112 Preparing the User Model for Logins......Page 114 Protecting Routes......Page 115 Adding a Login Form......Page 116 Signing Users In......Page 117 Testing Logins......Page 119 Adding a User Registration Form......Page 120 Registering New Users......Page 122 Generating Confirmation Tokens with itsdangerous......Page 123 Sending Confirmation Emails......Page 125 Account Management......Page 129 Database Representation of Roles......Page 131 Role Assignment......Page 133 Role Verification......Page 134 Profile Information......Page 139 User Profile Page......Page 140 User-Level Profile Editor......Page 142 Administrator-Level Profile Editor......Page 144 User Avatars......Page 147 Blog Post Submission and Display......Page 151 Blog Posts on Profile Pages......Page 154 Creating Fake Blog Post Data......Page 155 Rendering Data on Pages......Page 157 Adding a Pagination Widget......Page 158 Using Flask-PageDown......Page 161 Handling Rich Text on the Server......Page 163 Permanent Links to Blog Posts......Page 165 Blog Post Editor......Page 166 Database Relationships Revisited......Page 169 Many-to-Many Relationships......Page 170 Self-Referential Relationships......Page 171 Advanced Many-to-Many Relationships......Page 172 Followers on the Profile Page......Page 175 Query Followed Posts Using a Database Join......Page 178 Show Followed Posts on the Home Page......Page 180 Database Representation of Comments......Page 185 Comment Submission and Display......Page 187 Comment Moderation......Page 189 Introduction to REST......Page 195 Resources Are Everything......Page 196 Request and Response Bodies......Page 197 Versioning......Page 198 Creating an API Blueprint......Page 199 Error Handling......Page 200 User Authentication with Flask-HTTPAuth......Page 201 Token-Based Authentication......Page 204 Serializing Resources to and from JSON......Page 206 Implementing Resource Endpoints......Page 208 Pagination of Large Resource Collections......Page 211 Testing Web Services with HTTPie......Page 212 Part III. The Last Mile......Page 215 Obtaining Code Coverage Reports......Page 217 Testing Web Applications......Page 220 Testing Web Services......Page 224 End-to-End Testing with Selenium......Page 225 Is It Worth It?......Page 229 Logging Slow Database Performance......Page 231 Source Code Profiling......Page 233 Deployment Workflow......Page 235 Logging of Errors During Production......Page 236 Cloud Deployment......Page 237 Preparing the Application......Page 238 Testing with Foreman......Page 242 Enabling Secure HTTP with Flask-SSLify......Page 243 Deploying with git push......Page 245 Reviewing Logs......Page 246 Server Setup......Page 247 Setting Up Logging......Page 248 Using an Integrated Development Environment (IDE)......Page 251 Getting Involved with Flask......Page 252 Index......Page 255 About the Author......Page 258 Take full creative control of your web applications with Flask, the Python-based microframework. With this hands-on book, you’ll learn Flask from the ground up by developing a complete social blogging application step-by-step. Author Miguel Grinberg walks you through the framework’s core functionality, and shows you how to extend applications with advanced web techniques such as database migration and web service communication.Rather than impose development guidelines as other frameworks do, Flask leaves the business of extensions up to you. If you have Python experience, this book shows you how to take advantage of that creative freedom.Learn Flask’s basic application structure and write an example appWork with must-have components—templates, databases, web forms, and email supportUse packages and modules to structure a large application that scalesImplement user authentication, roles, and profilesBuild a blogging feature by reusing templates, paginating item lists, and working with rich textUse a Flask-based RESTful API to expose app functionality to smartphones, tablets, and other third-party clientsLearn how to run unit tests and enhance application performanceExplore options for deploying your web app to a production server
دانلود کتاب Flask Web Development: Developing Advanced Web Applications With Python