Flask Application Skeleton Example

A friend called me the other day wanting to learn more about putting together a Flask application. After brewing a good Catimor coffee variety from Dominican Republic I decided to get a sample Flask code for starters and share it with everybody. This Flask application includes: You can save this code to a Python file …

Postman Cannot Reach localhost macOS Sonoma

This was very frustrating I have to say! After coming to Punta del Diablo in Uruguay to have some time away from big cities like NYC. At the same time I wanted to do some self skills improvement while away. I started learning more about APIs, but I kept getting issues with postman not seeing …

Python3.9: bad interpreter: No such file or directory macOS Sonoma

Last week I decided to finally upgrade my macOS BigSur to Sonoma. As usual I get issues after the upgrade. For example, security settings, apps permissions, custom backup script I put together to backup my files to a NAS drive stop working. This time I got error “Python3.9: bad interpreter: No such file or directory“. …

RuntimeError: working outside of application context in Python Error

I have been working on a personal Flask app using SQLAlchemy for learning purposes and to improve my coding skills. As usual, I put it away for some months and then have to ‘re-learn’ what I did. Don’t do this! 🙂 I kept getting a new (at least for me!) error “RuntimeError: working outside of …

Changes in Flask Don’t Show in Docker Compose

When working on my blood pressure readings app I noticed changes in Flask Don’t Show in Docker Compose automatically. I had to do a docker compose down and then up to see a simple change to one of my HTML template files. This got me very frustrated and I had to run to the kitchen …

How to find Python shell executing in 32bit or 64bit

I was a little confused about how find Python shell executing in 32bit or 64bit. After taking a walk by the Buskwick Inlet Park in NYC I decided to look into this. I found a simple and quick way to find if my Python shell is executing in 32bit or 64bit. I’m using a macOS …

Docker failed to solve with frontend dockerfile.v0: failed to create LLB definition

I was working on improving my Flask skills and at the same time learning about REST APIs and how to build them using Flask, Docker, MongoDB and AWS. I’m using git in order to have my code available and practice whether at home or at the office macOS computer I have. Somehow, after pushing my …

Python’s built-in HTTP server handy one

While building my own Flask application for learning purposes. I was not sure how it was being served on the web. I did not install Apache of any other web server, but it is running on my Digital Ocean test server. The I found out about Python’s built-in HTTP server. This final purpose of this …

How to display time in Python

I have been using Flask to teach myself some coding and develop a web application for people with high blood pressure to track their daily blood pressure readings. I wanted to find a way to automatically display the time when a user takes a blood pressure reading. It was quite simple. Use strftime() to display …

How to run Ansible when Python not installed on Ubuntu EC2

I started an Ubuntu EC2 the other day hoping to run Ansible on it and was surprised that Python was not installed. A requirement for Ansible to run on target machines is to have a modern version of Python. You can just run sudo apt install python but this is not ideal if you need …