Learning Flask framework : build dynamic, data-driven websites and modern web applications with Flask / Matt Copperwaite, Charles Leifer
Mitwirkende(r): Resource type: Ressourcentyp: Buch (Online)Buch (Online)Sprache: Englisch Reihen: Community experience distilledVerlag: Birmingham ; Mumbai : Packt Publishing, November 2015Beschreibung: 1 online resource (xii, 226 pages)ISBN:- 9781783983377
- 005.1
- QA76.76.S63
- T55.4-60.8
Inhalte:
Zusammenfassung: 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 project -- The 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 precedence -- Building 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.PPN: PPN: 860316696Package identifier: Produktsigel: ZDB-26-MYL | ZDB-30-PQE | ZDB-38-EBR
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
Dieser Titel hat keine Exemplare