Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Flask Web and API Development
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering Flask Web and API Development

Mastering Flask Web and API Development

By : Sherwin John C. Tragura
5 (2)
close
close
Mastering Flask Web and API Development

Mastering Flask Web and API Development

5 (2)
By: Sherwin John C. Tragura

Overview of this book

Flask is a popular Python framework known for its lightweight and modular design. Mastering Flask Web and API Development will take you on an exhaustive tour of the Flask environment and teach you how to build a production-ready application. You’ll start by installing Flask and grasping fundamental concepts, such as MVC and ORM database access. Next, you’ll master structuring applications for scalability through Flask blueprints. As you progress, you’ll explore both SQL and NoSQL databases while creating REST APIs and implementing JWT authentication, and improve your skills in role-based access security, utilizing LDAP, OAuth, OpenID, and databases. The new project structure, managed by context managers, as well as ASGI support, has revolutionized Flask, and you’ll get to grips with these crucial upgrades. You'll also explore out-of-the-box integrations with technologies, such as RabbitMQ, Celery, NoSQL databases, PostgreSQL, and various external modules. The concluding chapters discuss enterprise-related challenges where Flask proves its mettle as a core solution. By the end of this book, you’ll be well-versed with Flask, seeing it not only as a lightweight web and API framework, but also as a potent problem-solving tool in your daily work, addressing integration and enterprise issues alongside Django and FastAPI.
Table of Contents (18 chapters)
close
close
1
Part 1:Learning the Flask 3.x Framework
6
Part 2:Building Advanced Flask 3.x Applications
12
Part 3:Testing, Deploying, and Building Enterprise-Grade Applications

Storing search data in Redis

Redis is a fast, open source, in-memory, key-value form of NoSQL storage that’s popular in messaging and caching. In Chapter 5, we used it as the message broker of Celery, while in Chapter 6, we used it as a message queue for the SSE and WebSocket programming. However, this chapter will utilize Redis as a data cache to create a fast search mechanism.

First, let’s install Redis on our system.

Installing the Redis server

For Windows, download the latest Redis TAR file from https://redis.io/download/, unzip it to an installation folder, and run redis-server.exe from the directory.

For WSL, run the following series of sudo commands:

sudo apt-add-repository ppa:redislabs/redis
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install redis-server

Then, run redis-cli -v to check if the installation was successful. If so, run the redis-server command to start the Redis server. Figure 7.13 shows the server log after the Redis...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY