Learning flask framework build dynamic, data-driven websites and modern web applications with 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 W...
Otros Autores: | , |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing
2015.
|
Edición: | 1st edition |
Colección: | Community experience distilled.
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009629675506719 |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Authors; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Creating your First Flask Application; What is Flask?; With great freedom comes great responsibility; Setting up a development environment; Supporting Python 3; Installing Python packages; Installing pip; Installing virtualenv; Why use virtualenv?; Installing virtualenv with pip; Creating your first Flask app; Installing Flask in your virtualenv; Hello, Flask!; Understanding the code; Routes and requests; Reading values from the request; Debugging Flask applications
- Introducing the blog projectThe spec; Creating the blog project; A barebones Flask app; Zooming out; The import flow; Summary; Chapter 2: Relational Databases with SQLAlchemy; Why use a relational database?; Introducing SQLAlchemy; Installing SQLAlchemy; Using SQLAlchemy in our Flask app; Choosing a database engine; Connecting to the database; Creating the Entry model; Creating the Entry table; Working with the Entry model; Making changes to an existing entry; Deleting an entry; Retrieving blog entries; Filtering the list of entries; Special lookups; Combining expressions; Negation
- Operator precedenceBuilding a tagging system; Adding and removing tags from entries; Using backrefs; Making changes to the schema; Adding Flask-Migrate to our project; Creating the initial migration; Adding a status column; Summary; Chapter 3: Templates and Views; Introducing Jinja2; Basic template operations; Loops, control structures, and template programming; Jinja2 built-in filters; Creating a base template for the blog; Creating a URL scheme; Defining the URL routes; Building the index view; Building the detail view; Listing entries matching a given tag; Listing all the tags
- Full-text searchAdding pagination links; Enhancing the blog app; Summary; Chapter 4: Forms and Validation; Getting started with WTForms; Defining a form for the Entry model; A form with a view; The create.html template; Handling form submissions; Validating input and displaying error messages; Editing existing entries; The edit.html template; Deleting entries; Cleaning up; Using flash messages; Displaying flash messages in the template; Saving and modifying tags on posts; Image uploads; Processing file uploads; The image upload template; Serving static files; Summary
- Chapter 5: Authenticating UsersCreating a user model; Installing Flask-Login; Implementing the Flask-Login interface; Creating user objects; Login and logout views; The login template; Logging out; Accessing the current user; Restricting access to views; Storing an entry's author; Setting the author on blog entries; Protecting the edit and delete views; Displaying a user's drafts; Sessions; Summary; Chapter 6: Building an Administrative Dashboard; Installing Flask-Admin; Adding Flask-Admin to our app; Exposing models through the Admin; Customizing the list views
- Adding search and filtering to the list view