How to Use Django’s Generic Foreign Key

Django provides the contenttypes framework that allows us to create generic relationships between models. This can be useful when you want to implement, for example,  a comment system where you can comment on posts, user profiles, images, and even comments themselves. In this tutorial, we will use the ContentType model, GenericForeignKey field, and GenericRelation to implement a comment system where users

Build a Blog with Django #1: Project Configuration

In this tutorial series, we are going to build a blog application with Python and the Django web framework. We will start from the configuration of the project then we will implement the following features: authentication, reset password, change password, comment, create a post, and finally we will deploy the application. Dependencies To check the

Edge and Contour Detection with OpenCV and Python

In this tutorial, we are going to see another image processing technique: detect edges and contours in an image. Edge detection is a fundamental task in computer vision. It can be defined as the task of finding boundaries between regions that have different properties, such as brightness or texture. Simply put, edge detection is the process of

Morphological Operations with OpenCV and Python

In this article we are going to see how to use the following morphological operations: Morphological operations are some transformations applied to grayscale or binary images. Morphological operations apply a structuring element to add or remove some pixels from the boundaries of objects in an input image. A structuring element is a matrix that defines the neighborhood