Learning Flask Framework

Matt Copperwaite, Charles Leifer

  • 出版商: Packt Publishing
  • 出版日期: 2015-11-30
  • 售價: $1,980
  • 貴賓價: 9.5$1,881
  • 語言: 英文
  • 頁數: 250
  • 裝訂: Paperback
  • ISBN: 1783983361
  • ISBN-13: 9781783983360
  • 相關分類: Flask
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述


Build dynamic, data-driven websites and modern web applications with Flask


About This Book



  • Discover the most popular Flask resources on the web with ease

  • Familiarize yourself with third-party libraries commonly used with Flask

  • Create a fast, interactive, and secure web app with this hands-on guide


Who This Book Is For


This book is for anyone who wants to develop their knowledge of Python into something that can be used on the web. Flask follows the Python design principles and can be easily understood by anyone who knows Python, and even by those who do not.


What You Will Learn



  • Create your web pages to add modularity and flexibility to your web app using templates

  • Store and retrieve relational data using SQLAlchemy

  • Develop schema migrations with Alembic

  • Produce an admin section using flask-admin

  • Build RESTful APIs using Flask-Restless

  • Simulate requests and sessions using the Flask test client

  • Make Ajax requests from Jinja2 templates


In Detail


Flask is a small and powerful web development framework for Python. It does not presume or force a developer to use a particular tool or library. Flask supports extensions that can add application features as if they were implemented in Flask itself. Flask's main task is to build web applications quickly and with less code. With its lightweight and efficient web development framework, Flask combines rapid development and clean, simple design.


This book will take you through the basics of learning how to apply your knowledge of Python to the web.


Starting with the creation of a "Hello world" Flask app, you will be introduced to the most common Flask APIs and Flask's interactive debugger. You will learn how to store and retrieve blog posts from a relational database using an ORM and also to map URLs to views. Furthermore, you will walk through template blocks, inheritance, file uploads, and static assets.


You will learn to authenticate users, build log in/log out functionality, and add an administrative dashboard for the blog. Moving on, you will discover how to make Ajax requests from the template and see how the Mock library can simplify testing complex interactions.


Finally, you will learn to deploy Flask applications securely and in an automated, repeatable manner, and explore some of the most popular Flask resources on the web.

商品描述(中文翻譯)

使用 Flask 建立動態、資料驅動的網站和現代網頁應用程式

關於本書
- 輕鬆探索網路上最受歡迎的 Flask 資源
- 熟悉與 Flask 常用的第三方函式庫
- 透過這本實作指南,建立快速、互動且安全的網頁應用程式

適合閱讀對象
本書適合任何希望將 Python 知識應用於網頁開發的人。Flask 遵循 Python 的設計原則,對於熟悉 Python 的人來說易於理解,甚至對於不熟悉 Python 的人也是如此。

你將學到什麼
- 使用模板為網頁增加模組化和彈性
- 使用 SQLAlchemy 儲存和擷取關聯式資料
- 使用 Alembic 開發資料庫模式遷移
- 使用 flask-admin 建立管理區域
- 使用 Flask-Restless 建立 RESTful API
- 使用 Flask 測試客戶端模擬請求和會話
- 在 Jinja2 模板中進行 Ajax 請求

詳細內容
Flask 是一個小而強大的 Python 網頁開發框架。它不假設或強制開發者使用特定的工具或函式庫。Flask 支援擴充功能,可以像在 Flask 本身中實現一樣添加應用程式功能。Flask 的主要任務是快速建立網頁應用程式,並使用更少的程式碼。憑藉其輕量且高效的網頁開發框架,Flask 結合了快速開發和乾淨簡單的設計。

本書將帶領你從基礎開始,學習如何將 Python 知識應用於網頁開發。從創建一個「Hello world」Flask 應用程式開始,你將介紹最常見的 Flask API 和 Flask 的互動式偵錯器。你將學習如何使用 ORM 從關聯式資料庫中儲存和擷取部落格文章,並將 URL 對應到視圖。此外,你還將學習模板區塊、繼承、檔案上傳和靜態資源。

你將學習驗證使用者、建立登入/登出功能,並為部落格添加管理儀表板。接著,你將發現如何從模板中進行 Ajax 請求,並了解 Mock 函式庫如何簡化測試複雜互動。

最後,你將學習如何安全且自動化地部署 Flask 應用程式,並探索網路上最受歡迎的 Flask 資源。