Video: How To Fix an Internal Server Error in Flask

Posted by
on under

In this beginner level video I explain what steps you need to take when you get an Internal Server Error in your Flask application.

Fixing ALTER TABLE errors with Flask-Migrate and SQLite

Posted by
on under

If you've done any work with SQLite databases you surely know that this database is very limited in terms of making changes to the database schema. When working with a migration framework such as Flask-Migrate, it is common to end up with migration scripts that fail to upgrade or downgrade just because they need to remove or modify a column in a table, something that SQLite does not support.

In this article I'm going to discuss this limitation of the SQLite database, and show you a workaround that is specific to Flask-Migrate and Alembic.

Run Your Flask Regularly Scheduled Jobs with Cron

Posted by
on under

A common need of web applications is to have a periodically running task in the background. This could be a task that imports new data from third party sources, or maybe one that removes revoked tokens from your database once they have expired. In this and many other situations you are faced with the challenge of implementing a task that runs in the background at regular intervals.

This is a pattern that many people ask me about. I've seen implementations that are based on the APScheduler package, on Celery, and even homegrown solutions built inside a background thread. Sadly none of these options are very good. In this article I'm going to show you what I believe is a very robust implementation that is based on the Flask CLI and the cron service.

Access Localhost From Your Phone Or From Anywhere In The World

Posted by
on under

Sometimes it is useful to quickly access your Flask application running on localhost from another device or location for testing purposes. In this article I'll show you how to use the pyngrok package to provision a temporary public URL for your application that works from your phone or from anywhere in the world!

Introduction to JavaScript Arrow Functions

Posted by
on under

After I published the tutorial on JavaScript Promises, several people told me that they did not know the new arrow function syntax introduced in the ES6 version of the language.

In this article I'll give you an overview of this syntax, along with information on what platforms support it and how to use them even in older platforms.

Video: Using Trailing Commas in Python

Posted by
on under

In this short video I comment on the benefits of using "trailing commas" when defining data structures in Python.

Video: Introduction to Terminal Multiplexing with Tmux

Posted by
on under

In this video I demonstrate how I used tmux alongisde vim.

Download my .tmux.conf file if you want something to start experimenting with tmux!

Video: Setting Up Vim to Work with Python Applications

Posted by
on under

In this short video tutorial I demonstrate my Vim editor setup for working with Python applications.

Do you want to try this out? Download my .vimrc file! If your tagbar does not work, install Exuberant Ctags (use brew install ctags or sudo apt-get install ctags, or download from http://ctags.sourceforge.net/)

How To Add Flask-Migrate To An Existing Project

Posted by
on under

A question that I frequently get is how to start tracking database migrations with my Flask-Migrate extension when the project has an established database, making it impossible to delete everything and start over from scratch. In this article and companion video I'm going to show you how to set up Flask-Migrate with zero risk for your current database.

Video: MicroPython Heats My Home

Posted by
on under

In this video I discuss a little MicroPython based project that I implemented in my home to improve the efficiency of the heating controller.