How To Add Dark Mode Support To Your Website
Miguel Grinberg Blog
by Miguel Grinberg
4M ago
You may have noticed that I have recently added a dark mode to this blog. The default color theme now follows the theme setting in your operating system by default, and you can also select which mode to enable from the top navigation bar. Nice, right? I have implemented this feature entirely in the front end, using CSS and a touch of JavaScript. Interested in implementing a similar feature for your own website? In this article I'll show you how I did it ..read more
Visit website
Eliza-GPT: The Classic ELIZA Chatbot Running On OpenAI's Chat Completions API
Miguel Grinberg Blog
by Miguel Grinberg
4M ago
ELIZA is possibly the first chatbot ever created, dating back to 1966. It was created by Joseph Weizenbaum as an early experiment in natural language processing (NLP). ELIZA is able to hold a conversation in English with a human, and is programmed through a set of pattern matching rules to respond to the user in ways that are similar to how a psychotherapist would. The OpenAI Chat Completions API is a widely used API to chat with Large Language Models (LLMs) such as ChatGPT, and has become a sort of standard for turn-based conversational services. Could 1960s ELIZA be adapted to work as a web ..read more
Visit website
Microdot: Yet Another Python Web Framework
Miguel Grinberg Blog
by Miguel Grinberg
4M ago
I just realized that I have never written on this blog about Microdot, my very own web framework for Python. I have released Microdot 2.0 a few days ago, so I guess this is a good time to make a belated announcement, and tell you why this world needs yet another Python web framework. But before I tell you about the reasons and the history of Microdot, let me share some of its features: Flask-like syntax, but without the magical/obscure parts (no application/request contexts) Small enough to work with MicroPython, while also being compatible with CPython Fully compatible with asyncio Websocket ..read more
Visit website
Announcing the Flask Mega-Tutorial, 2024 Edition
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
Today I'm super-excited to share that I have made available a major update to the Flask Mega-Tutorial, which I'm calling the "2024 Edition". In the following sections I'll re-introduce the tutorial in case you have not seen it before, and I'll also go over the changes and improvements in this revised edition ..read more
Visit website
It's Time For A Change: datetime.utcnow() Is Now Deprecated
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
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 alternative, in preparation for the eventual removal of this function (likely a few years out, so no need to panic!). In this short article I'll tell you more about why these functions are getting the ..read more
Visit website
Some More To Talk About Flask
Miguel Grinberg Blog
by Miguel Grinberg
6M ago
A few days ago I published a harsh critique of the Flask's team practices with regards to releases, versioning and especially about their weak backwards compatibility track record. This generated a bit of a stir and lots of people, including members of the Flask core development itself, have voiced their opinions. I'm going to start by admitting that even though I have received some support, there has been a lot of push back as well. I really have no problem with this, as I don't hide from criticism. In this follow up article I'm going to talk about the good and the bad takes that resulted fro ..read more
Visit website
We Have To Talk About Flask
Miguel Grinberg Blog
by Miguel Grinberg
6M ago
tl;dr: Flask maintainers often introduce trivial backwards incompatible changes into new releases of Flask and Werkzeug, causing extensions and tutorials to break until they are updated. Flask 3.0 was released on September 30th, 2023, along with a parallel 3.0 release of Werkzeug, its main dependency. That day, the Flask-Login extension, one of the most popular of all Flask extensions, stopped working due to a backwards incompatible change introduced in Werkzeug. It is October 19th when I'm writing this, and Flask-Login remains broken. As a result, any person using my Flask Mega-Tutorial will ..read more
Visit website
Building a Toy Programming Language in Python, Part 2
Miguel Grinberg Blog
by Miguel Grinberg
10M ago
Welcome to the second part of my tutorial on creating a toy language I called my in Python. In the first part I showed how how to implement the lexer, parser and interpreter for a very simple version of the language that did only one thing: print numbers. With the first phase of the project completed, and with a solid base to start building from, I'll show you how to extend the language in a few ways. The purpose of this is to demonstrate how to modify this language, so that you can then build your own extensions. If you need a reference for the code, this GitHub repository has the working cod ..read more
Visit website
Building a Toy Programming Language in Python
Miguel Grinberg Blog
by Miguel Grinberg
10M ago
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). The implementation is going to be in Python, without any external dependencies. The my language is simple enough to make this project reasonably short, but also complex enough to make it interesting ..read more
Visit website
Goodbye, Twilio
Miguel Grinberg Blog
by Miguel Grinberg
11M ago
As of this week and after almost four years, I'm not a Twilio employee anymore. I'm writing this while I work through a range of conflicting emotions, and try to adapt to new daily routines without Twilio in my life. Before you jump to conclusions let me clarify that I have not been laid off. The decision to leave the company was mine alone. When I joined Twilio in 2019, this is how the company presented itself to the world, as seen through the famous billboard on the 101 freeway in San Francisco: The three words in this billboard are possibly one of the best marketing campaigns of all times ..read more
Visit website

Follow Miguel Grinberg Blog on FeedSpot

Continue with Google
Continue with Apple
OR