Join 30,341 other Developers as we Learn, Build, and Grow Together.

Connect with fellow developers and gain access to tools that will help you build a profitable SaaS 🚀

Sign Up

Python

Python posts, videos, courses, and more

Performance Monitoring with Elastic APM

Performance Monitoring with Elastic APM

In this post we will setup a Python Flask Application which includes the APM Agent which will collect metrics, that gets pushed to the APM Server. If you have not setup the Elastic Stack with / or APM Server, you can follow this post to setup the needed. Then we will make a bunch of HTTP Requests to our Application and will go...

Ruan Bekker

2 months ago

2
Select One:
Weather Monitoring with Grafana and the DHT22 Sensor

Weather Monitoring with Grafana and the DHT22 Sensor

In this tutorial, we will connect the DHT22 sensor to the Raspberry Pi Zero via the GPIO pins to measure temperature and humidity and visualize it with Grafana. Then we will write a Python exporter for prometheus to expose our metrics so that we can visualize it in Grafana. The Endgoal The Hardware This is how the sensor looks...

Ruan Bekker

3 months ago

4
Select One:
AWS S3 KMS and Python for Secrets Management

AWS S3 KMS and Python for Secrets Management

So your application need to store secrets and you are looking for a home for them. In this tutorial we will see how we can use Python, S3 and KMS to build our own solution for managing secrets. There is SSM and Secrets Manager that probably does a better job, but my mind got curious :D High Level Goal From a High-Level we want t...

Ruan Bekker

3 months ago

3
Select One:
Using Python RQ for Task Queues in Python

Using Python RQ for Task Queues in Python

This is a getting started on python-rq tutorial and I will demonstrate how to work with asynchronous tasks using python redis queue (python-rq). What will we be doing We want a client to submit 1000's of jobs in a non-blocking asynchronous fashion, and then we will have workers which will consume these jobs from our redis queue,...

Ruan Bekker

4 months ago

5
Select One:
Gitlab CICD Pipeline to Deploy your Python Flask API with Postgres on Heroku

Gitlab CICD Pipeline to Deploy your Python Flask API with Postgres on Heroku

Today we will build a Restful API using Python Flask, SQLAlchemy using Postgres as our Database, testing using Python Unittest, a CI/CD Pipeline on Gitlab, and Deployment to Heroku. Should you be interested in setting up a Custom Gitlab Runner on Your Own Server for Gitlab CI have a look at the embedded post. Heroku If you don'...

Ruan Bekker

4 months ago

4
Select One:
Encryption using PyCrypto in Python

Encryption using PyCrypto in Python

While I'm learning a lot about encryption at the moment, I wanted to test out encryption with the PyCrypto module in Python using the Advanced Encryption Standard (AES) Symmetric Block Cipher. Installing PyCrypto: $ pip install pycrypto --user PyCrypto Example: Our AES Key needs to be either 16, 24 or 32 bytes long and our Init...

Ruan Bekker

4 months ago

3
Select One:
Improve MySQL Write Performance Using Batch Writes

Improve MySQL Write Performance Using Batch Writes

I am no DBA, but I got curious when I noticed sluggish write performance on a mysql database, and I remembered somewhere that you should always use batch writes over sequential writes. So I decided to test it out, using a python script and a mysql server. What will we be doing I wrote a python script that writes 100,000 records...

Ruan Bekker

5 months ago

2
Select One:
Sending Slack Messages with Python

Sending Slack Messages with Python

In this post I will demonstrate how to send messages to slack using python based on the status of an event. We will keep it basic, that when something is down or up, it should send a slack message with the status, message, color and embed your grafana dashboard links inside the alert (or any links that you would like). Create a...

Ruan Bekker

5 months ago

2
Select One:
Python Classes/Objects

Python Classes/Objects

Python Classes/ObjectsPython is an object oriented programming language.Almost everything in Python is an object, with its properties and methods.A Class is like an object constructor, or a "blueprint" for creating objects.Create a ClassTo create a class, use the keyword class:

Amine Dev

2 years ago

Select One:
Python : methods of list objects

Python : methods of list objects

 List in pythonA list is a collection which is ordered and changeable. In Python lists are written with square brackets.

Amine Dev

2 years ago

Select One:
Getting a user’s country, currency, timezone or language from their IP address

Getting a user’s country, currency, timezone or language from their IP address

In many projects in the past, when I’ve had to use a Geo IP API service to look up a user’s IP address, it was usually for one of several reasons — getting the user’s country (for geo-locking certain features, or defaulting to certain sections or categories of the site), defaulting a user’s created account to a certain currency,...

Wael Manai

2 years ago

Select One:

Loading More Content