Friday Picks 032

Here are 5 links for this Friday: How to create a simple REST API with Python and Flask in 5 minutes - a beginner-friendly Python & Flask tutorial What is Phoenix LiveView - a good overview about the new experimental feature in Elixir's web framework For a Good strftime - if you quickly want to look up how to format a string in Python Introduction to CSS - Youtube series about CSS A Recap of Frontend Development in 2019 - what happened in 2019?
Read more →

Friday Picks 031

Read more →

Month of Testdriven Python and React

Read more →

TIL: ASGI for Python

Today I learned about the ASGI specification for Python frameworks: ASGI (Asynchronous Server Gateway Interface) is a spiritual successor to WSGI, intended to provide a standard interface between async-capable Python web servers, frameworks, and applications. Python didn't have asynchronous execution until recently. Since Python 3.4 there's asyncio in the standard library. asyncio is singl-threaded, single-process - like JavaScript's event loop. ASGI is build on top of asyncio. So, basically, Python now has web servers and frameworks with async capacities.
Read more →

Flask Is Complicated

I'm currently creating some micro-service applications with Docker and Flask. Python is quite a beginner-friendly language, and Flask is easy to get started with. At the same time, it isn't straightforward to add more than basic features. For example, the tutorials use Flask-RESTful. Adding Swagger-UI to my “standard” Docker image is quite a hassle. You can use flask-swagger-ui, but then you have to figure out how to serve the static json file.
Read more →

Friday Picks 030

Read more →

2019 Week 50: A Look Back

Read more →

Create a Multi-Stage Docker Build for Python Flask and Postgres

A few days ago, I created a Docker build for Flask with PostgreSQL (both with Alpine Linux and with Debian Linux). Installing psypcopg-2 binary (required for Postgres) requires you to build the package from source. Now the Docker image grows in size, as it still contains the build artifacts. The solution? Multi-stage Docker builds. Let's say we have the following docker-compose.yml file. There are two services: a Flask API called users and a Postgres database called users-db.
Read more →

Handle Python Dependency Management With Virtual Environments

Create isolated Python projects with virtual environments What is a virtual environments and why should I use it? A virtual environment allows you to develop several Python projects with different versions of packages on the same computer. Python usually installs the latest versions of your dependencies globally. You'll run into problems, if one of your projects requires a different package version. venv Python ships with venv out of the box since version 3.
Read more →

Install psycopg2-binary With Docker

How to build a Python app with PostgreSQL I'm currently setting up a Flask app with PostgreSQL and Docker. Like most examples you'll find on the internet, the course I'm following uses Alpine Linux as a base image. Alpine's selling point is the small image size. But Alpine uses a different C library, musl, instead of glibc. That's one of the reasons why the website Pythonspeed recommends Debian Buster as the base image for Python (as of 2019).
Read more →