Systems | Development | Analytics | API | Testing

Deploy a Python Flask App to Render with Docker

In this tutorial, we will build a Flask app with Docker, create a background worker with Celery, and use RabbitMQ as the message broker between the two services. This (relatively) simple example will be used to demonstrate how Docker makes it easier to run multiple services and share configuration details between developers. In the last section, we will also build and optimize our app for deployment to Render, so we can avoid some of the common gotchas it is easy to fall victim to along the way!

What Is A Python Bytestring?

In the programming language, Python, binary data and text are often used when working with files, APIs, data encoding and decoding, and networking. In this article, we are going to answer some of the common questions that arise in this process. Some of which include what bytestrings are, how to convert strings to bytes and vice versa, their differences, and many more. This guide will cover all that is required for you to master bytestrings in Python.

How the Application and Request Contexts Work in Python Flask

If you have spent some time developing Flask applications, you have probably encountered terms like request, session, current_app, and g. You might even use them daily. But have you ever stopped to think about how Flask makes these seemingly global objects available exactly when you need them, especially in a multi-threaded web server environment? Well, the magic lies in Flask's context system. In this article, you will learn what contexts are in Flask and how to use them with practical examples.

How To Create A Pandas Pivot Table In Python

In today’s data-driven world, collecting data is easy, but making sense of it is what truly matters. That’s where Pandas pivot tables come into play. With just a few lines of Python, you can quickly turn disorganized data into meaningful, well-structured summaries. Imagine Excel pivot tables, but faster, more flexible, and fully powered by code.

How to Use MongoDB in Python Flask

When developing software applications, data storage is a key concern. The reality is that your first concern should be the data model you choose, which in turn affects how you store data. Generally speaking, this means deciding between SQL and NoSQL databases. In this article, you will learn how to use MongoDB, a popular NoSQL database, in a Flask application. First, you will learn why MongoDB is a good choice, and then we will implement a practical hands-on project using MongoDB in Flask.

Python Switch Case: How To Implement Switch Statements In Python

Have you ever wished Python had a native switch-case statement like C or Java? It would make conditional logic so much easier to read, especially when you have more than 3 conditions to handle. While Python doesn’t offer a built-in switch-case structure, the good news is that there are clean and Pythonic ways to achieve the same behavior. In this blog, let’s explore three practical ways to implement switch-case in Python with real examples and how to make sure they work using automated tests.

Flask or Django: Which One Best Fits Your Python Project?

Choosing the right framework can significantly impact the success of a dev project. If you've chosen to use Python for your project's backend, you might need to decide between Flask and Django, the most popular web frameworks in the Python ecosystem. This article will help you determine which of the two best suits your specific needs by examining the key factors to consider. Before diving into the technicalities, let's briefly introduce both Flask and Django.

What Does Enumerate Mean In Python

When you use loops in Python, there are a lot of times when you don’t just want the item from a list, you also want to know where that item is in the list. For example, going through a list of names and needing to show their position, like “1. Alice”, “2. Bob”, and so on, or you could be building a menu where each option needs a number next to it. In these situations, Python’s enumerate() function is very helpful.