サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
ドラクエ3
blog.miguelgrinberg.com
I often come across developers who know the mechanics of Python error handling well, yet when I review their code I find it to be far from good. Exceptions in Python is one of those areas that have a surface layer that most people know, and a deeper, almost secret one that a lot of developers don't even know exists. If you want to test yourself on this topic, see if you can answer the following qu
I was going through the release notes of the new Python 3.12 version the other day, and one item caught my attention in the deprecations section: datetime.datetime’s utcnow() and utcfromtimestamp() are deprecated and will be removed in a future version. If you have followed my web development tutorials you must have seen me use utcnow() a lot, so I will clearly need to re-train myself to use an al
I thought it would be fun to go outside of my comfort zone of web development topics and write about something completely different and new, something I have never written about before. So today, I'm going to show you how to implement a programming language! The project will parse and execute programs written in a simple language I called my (I know it's a lame name, but hey, it is "my" language).
Have you heard people say that async Python code is faster than "normal" (or sync) Python code? How can that be? In this article I'm going to try to explain what async is and how it differs from normal Python code. What Do "Sync" and "Async" Mean? Web applications often have to deal with many requests, all arriving from different clients and within a short period of time. To avoid processing delay
After I published my article on using Celery with Flask, several readers asked how this integration can be done when using a large Flask application organized around the application factory pattern. It's a very good question, as it is non-trivial to make Celery, which does not have a dedicated Flask extension, delay access to the application until the factory function is invoked. In this article I
In this article I'm going to introduce an authentication scheme known as two factor authentication. As the name implies, this method requires the user to provide two forms of identification: a regular password and a one-time token. This greatly increases account security, because a compromised password alone is not enough to gain access, an attacker also needs to have the token, which is different
The topic of running background tasks is complex, and because of that there is a lot of confusion around it. I have tackled it in my Mega-Tutorial, later in my book, and then again in much more detail in my REST API training video. To keep things simple, in all the examples I have used so far I have executed background tasks in threads, but I always noted that for a more scalable and production re
Many web sites offer users the option to use a streamlined single-click registration and login built on third party authentication services, typically run by the big social networks. In this article I want to give you an introduction to the OAuth protocol, which is one of the most used third-party authentication mechanism. I will also show you a complete Flask application that implements "Sign In
I'm sure by now you know that I have released a book and a couple of videos on Flask in cooperation with O'Reilly Media. While the coverage of the Flask framework in these is fairly complete, there are a small number of features that for one reason or another did not get mentioned much, so I thought it would be a good idea to write articles about them here. This article is dedicated to streaming,
(Great news! There is a new version of this tutorial!) This is the fourteenth article in the series in which I document my experience writing web applications in Python using the Flask microframework. The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog. NOTE: This article was revis
This weekend I decided to take a short vacation from my book writing effort and spend time on a project I wanted to work on for a long time. The result of this effort is a brand new Flask extension that I think is pretty cool. I'm happy to introduce Flask-SocketIO, a very easy to use extension that enables WebSocket communications in Flask applications. What is WebSocket? WebSocket is a new commun
This article is the fourth in my series on RESTful APIs. Today I will be showing you a simple, yet secure way to protect a Flask based API with password or token based authentication. This article stands on its own, but if you feel you need to catch up here are the links to the previous articles: Designing a RESTful API with Python and Flask Writing a Javascript REST client Designing a RESTful API
The only resource exposed by this service is a "task", which has the following data fields: uri: unique URI for the task. String type. title: short task description. String type. description: long task description. Text type. done: task completion state. Boolean type. Routing In my first RESTful server example (source code here) I have used regular Flask view functions to define all the routes. Fl
(I can't help it. I keep coming up with ideas for cool Flask extensions.) If you've asked or answered a question on Stack Overflow you have seen the editor that they use. You type your text using Markdown syntax in a standard text area HTML control and below it a preview is generated as you type. This editor is powered by an open source project called PageDown. Today I'm introducing Flask-PageDown
(Great news! There is a new version of this tutorial!) This is the sixteenth article in the series in which I document my experience writing web applications in Python using the Flask microframework. The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog. NOTE: This article was revise
This is the eighth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to implement a "followers" feature similar to that of Twitter and other social networks. You are reading the 2024 edition of the Flask Mega-Tutorial. The complete course is also available to order in e-book and paperback formats from Amazon. Thank you for your support! If you are looking for the 20
This is the fifth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to create a user login subsystem. You are reading the 2024 edition of the Flask Mega-Tutorial. The complete course is also available to order in e-book and paperback formats from Amazon. Thank you for your support! If you are looking for the 2018 edition of this course, you can find it here. For you
This is the fourth installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to work with databases. You are reading the 2024 edition of the Flask Mega-Tutorial. The complete course is also available to order in e-book and paperback formats from Amazon. Thank you for your support! If you are looking for the 2018 edition of this course, you can find it here. For your referen
In recent years REST (REpresentational State Transfer) has emerged as the standard architectural design for web services and web APIs. In this article I'm going to show you how easy it is to create a RESTful web service using Python and the Flask microframework. What is REST? The characteristics of a REST system are defined by six design rules: Client-Server: There should be a separation between t
This is the third installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to work with web forms. You are reading the 2024 edition of the Flask Mega-Tutorial. The complete course is also available to order in e-book and paperback formats from Amazon. Thank you for your support! If you are looking for the 2018 edition of this course, you can find it here. For your referenc
Web scraping is a technique used to extract data from websites using a computer program that acts as a web browser. The program requests pages from web servers in the same way a web browser does, and it may even simulate a user logging in to obtain access. It downloads the pages containing the desired data and extracts the data out of the HTML code. Once the data is extracted it can be reformatted
(Great news! There is a new version of this tutorial!) This is the tenth article in the series in which I document my experience writing web applications in Python using the Flask microframework. The goal of the tutorial series is to develop a decently featured microblogging application that demonstrating total lack of originality I have decided to call microblog. NOTE: This article was revised in
You are reading the 2024 edition of the Flask Mega-Tutorial. The complete course is also available to order in e-book and paperback formats from Amazon. Thank you for your support! If you are looking for the 2018 edition of this course, you can find it here. For your reference, here is the complete list of articles in this series: Chapter 1: Hello, World! (this article) Chapter 2: Templates Chapte
このページを最初にブックマークしてみませんか?
『miguelgrinberg.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く