blog.miguelgrinberg.com Open in urlscan Pro
138.68.45.120  Public Scan

Submitted URL: http://miguelgrinberg.com/
Effective URL: https://blog.miguelgrinberg.com/
Submission: On May 31 via api from GB — Scanned from GB

Form analysis 0 forms found in the DOM

Text Content

Toggle navigation miguelgrinberg.com
 * Home
 * My Courses and Books
 * About Me

 * 

May 16 2022


THE REACT MEGA-TUTORIAL, CHAPTER 4: ROUTING AND PAGE NAVIGATION

Posted by Miguel Grinberg under JavaScript, Programming, React.

React is a Single-Page Application (SPA) framework, which means that from the
point of view of the browser, only one web page is ever downloaded. Once that
page is active, all the application state changes will happen through JavaScript
events, without the browser having to fetch new web pages from the server. How
then, can the application support page navigation?

Read more...

May 1 2022


THE REACT MEGA-TUTORIAL, CHAPTER 3: WORKING WITH COMPONENTS

Posted by Miguel Grinberg under React, JavaScript, Programming.

In Chapter 2, you wrote your first React component. In this chapter you will
delve deeper into React as you learn how to create robust applications by
combining and reusing components, not only your own but also some imported from
third-party libraries.

6 COMMENTS

Read more...

April 16 2022


THE REACT MEGA-TUTORIAL, CHAPTER 2: HELLO, REACT!

Posted by Miguel Grinberg under JavaScript, React, Programming.

In this chapter you will take your first steps as a React developer. When you
reach the end you will have a first version of a microblogging application
running on your computer!

3 COMMENTS

Read more...

April 2 2022


THE REACT MEGA-TUTORIAL, CHAPTER 1: MODERN JAVASCRIPT

Posted by Miguel Grinberg under JavaScript, React, Programming.

The JavaScript language has evolved significantly in the last few years, but
because browsers have been slow in adopting these changes a lot of people have
not kept up with the language. React encourages developers to use modern
JavaScript, so this chapter gives you an overview of the newest features of the
language.

15 COMMENTS

Read more...

April 2 2022


INTRODUCING THE REACT MEGA-TUTORIAL

Posted by Miguel Grinberg under Programming, JavaScript, React.

Welcome to the React Mega-Tutorial! In this series I will share my experience in
developing real-world, non-trivial front end applications using the React
library and a handful of related packages.



Unlike most other books and tutorials, the React Mega-Tutorial will take you on
a development journey. Instead of teaching you React concepts with isolated
examples, it will show you how to develop a complete front end application. You
will begin by creating a brand new React project, and then start adding features
and functionality to it as you progress through the chapters. When you reach the
end, you will have a complete project of which you will understand every single
line of code. More importantly, you will understand the concepts and techniques
involved in creating it, in way that will be directly applicable to your own
projects.

19 COMMENTS

Read more...

December 3 2021


API AUTHENTICATION WITH TOKENS

Posted by Miguel Grinberg under Flask, Python, Programming, Authentication,
Security.

In this article I'm going to show you a few common patterns for client
authentication based on tokens, and how can they be implemented in a Python API
back end. This method of authentication works well for rich clients, like
JavaScript-based front end applications running in the browser, or perhaps a
command-line (CLI) application.

I have written about Authentication several times on this blog, so this article
is a bit different. Since I have already provided a few authentication projects
in previous articles and in my open source projects, in this article I'm going
to go over all the considerations you have to take into account when deciding
how to best implement authentication for your own API project.

This article was voted by my supporters on Patreon. Would you like to support my
work, and as a thank you be able to vote on my future articles and also have
access to a chat room where I hang out? Become a Patron!

2 COMMENTS

Read more...

November 24 2021


USING JAVASCRIPT-STYLE ASYNC PROMISES IN PYTHON

Posted by Miguel Grinberg under JavaScript, Programming, Python.

When you compare Python and JavaScript async code, you may think they are very
much alike, since both use the async/await pattern. In reality, there is a
significant difference between the two, which in my opinion, makes the
JavaScript async model superior to Python's.

Do you want to know what the difference is, and how to make async Python work
like async JavaScript? Watch or read on for the details!



10 COMMENTS

Read more...

October 31 2021


ADD A WEBSOCKET ROUTE TO YOUR FLASK 2.X APPLICATION

Posted by Miguel Grinberg under Flask, Programming, Python.

The WebSocket protocol was standardized 10 years ago (in 2011, can you believe
it?) so I'm sure for many of it you does not need an introduction. But in case
you are not familiar with it, WebSocket is an extension to the HTTP protocol
that provides a permanent, bi-directional communication channel between a client
and the server, where both sides can send and receive data in real time, free of
the constraints of the request/response cycle of HTTP.

Flask, being a minimalist web framework, does not have WebSocket support
built-in. The old Flask-Sockets extension, which has not been maintained in the
last few years, provided support for this protocol. My own Flask-SocketIO
extension has also been a favorite, but this is Socket.IO, which is a more
complex protocol that combines WebSocket and HTTP.

The good news is that if you are using Flask 2 you now have a new extension
(also created by myself) called Flask-Sock, which provides modern WebSocket
support for your application. In this article I'm going to show you how to work
with this extension.

This article was voted by my supporters on Patreon. Would you like to support my
work, and as a thank you be able to vote on my future articles and also have
access to a chat room where I hang out? Become a Patron!

18 COMMENTS

Read more...

October 3 2021


ACCEPT CREDIT CARD PAYMENTS IN FLASK WITH STRIPE CHECKOUT

Posted by Miguel Grinberg under Programming, Flask, Python.

In this article I'm going to show you how to implement an order page for your
Flask application that you can use to sell products or services online. The
solution I'm going to present to you uses Stripe Checkout, a secure and easy to
use credit card charging service that integrates nicely with Flask.

This article was voted by my supporters on Patreon. Would you like to support my
work, and as a thank you be able to vote on my future articles and also have
access to a chat room where I hang out and answer questions? Become a Patron!

9 COMMENTS

Read more...

September 1 2021


OPTIMIZING SLOW SQL QUERIES

Posted by Miguel Grinberg under Database, Programming.

Most database problems go unnoticed during development, because we tend to code
our applications using small datasets. It is when the application has been on
production for some time that database performance issues start to appear,
causing parts of the application to become slower and slower as the database
continues to grow.

How do you debug and identify this type of problems? In this article I'm going
to show you how to fix the most common database performance problems, which are
those that are caused by improper indexing. Examples for Postgres, MySQL and
SQLite are included!

This article was voted by my supporters on Patreon. Would you like to support my
work, and as a thank you be able to vote on my future articles and have access
to a chat room where I hang out and answer questions? Become a Patron!

3 COMMENTS

Read more...
 * ← Newer Posts
 * Older Posts →


FLASK WEB DEVELOPMENT, 2ND EDITION

If you want to learn modern web development techniques with Python and Flask,
you may find the second edition of my O'Reilly book useful:






ABOUT MIGUEL

Welcome to my blog!

I'm a software engineer, photographer and filmmaker, currently living in
Drogheda, Ireland.

You can also find me on Twitter, YouTube, Github, LinkedIn, Facebook and
Patreon.

Thank you for visiting!


CATEGORIES

 * AWS (1)
 * Arduino (7)
 * Authentication (8)
 * Blog (1)
 * C++ (5)
 * Cloud (8)
 * Database (16)
 * Docker (2)
 * Filmmaking (6)
 * Flask (98)
 * Games (1)
 * HTML5 (1)
 * Heroku (1)
 * IoT (8)
 * JavaScript (22)
 * MicroPython (8)
 * Microservices (2)
 * Movie Reviews (5)
 * OpenStack (1)
 * Personal (2)
 * Photography (7)
 * Product Reviews (2)
 * Programming (146)
 * Project Management (1)
 * Python (134)
 * REST (6)
 * Rackspace (1)
 * Raspberry Pi (7)
 * React (10)
 * Robotics (6)
 * Security (11)
 * Video (22)
 * Webcast (3)
 * Windows (1)

© 2012-2022 by Miguel Grinberg. All rights reserved. Questions?