Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Flask Framework

You're reading from   Learning Flask Framework Build dynamic, data-driven websites and modern web applications with Flask

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher
ISBN-13 9781783983360
Length 250 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Creating Your First Flask Application FREE CHAPTER 2. Relational Databases with SQLAlchemy 3. Templates and Views 4. Forms and Validation 5. Authenticating Users 6. Building an Administrative Dashboard 7. AJAX and RESTful APIs 8. Testing Flask Apps 9. Excellent Extensions 10. Deploying Your Application Index

Introducing SQLAlchemy


SQLAlchemy is an extremely powerful library for working with relational databases in Python. Instead of writing SQL queries by hand, we can use normal Python objects to represent database tables and execute queries. There are a number of benefits to this approach, as follows:

  • Your application can be developed entirely in Python.

  • Subtle differences between database engines are abstracted away. This allows you to do things just like a lightweight database, for instance, use SQLite for local development and testing, then switch to the databases designed for high loads (such as PostgreSQL) in production.

  • Database errors are less common because there are now two layers between your application and the database server: the Python interpreter itself (this will catch the obvious syntax errors), and SQLAlchemy, which has well-defined APIs and its own layer of error-checking.

  • Your database code may become more efficient, thanks to SQLAlchemy's unit-of-work model that helps reduce...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image