jesse_jcharis

Django Query Optimization – Avoiding N + 1 Problems

There are several ways to avoid the N+1 query problem in Django: Use select_related: select_related is a method that performs a SQL join and includes the fields of the related object in the SELECT statement. It’s useful when you have ForeignKey or OneToOneField on your model and you know you’ll be accessing the related object for each item …

Django Query Optimization – Avoiding N + 1 Problems Read More »

Copying Model Instance Vs Versioning Model Instance In Django

Recently I was working on a project that involved how to keep track of changes made to a django model. This brought us to consider which approach to use, i.e whether to copy or to version using different strategies. To begin let us understand the different between the two concept. Difference Between Copying A Model …

Copying Model Instance Vs Versioning Model Instance In Django Read More »

How to Work with UFW – Uncomplicated Firewall

Ufw (Uncomplicated Firewall) is a firewall management software which is quite useful during devops and system administrative tasks. By the end of this post, you will learn How to install and setup a firewall How to allow and deny access via ports How to delete rules etc Let us start. Installation and Setup To install …

How to Work with UFW – Uncomplicated Firewall Read More »

Multiple Select with Django Forms

To use a multiple select with Django ModelChoiceField for forms, you should use the ModelMultipleChoiceField instead. This field allows you to select multiple options from a queryset of model instances.Here’s an example of how to use ModelMultipleChoiceField with a multiple select widget in a Django form: Create your models: Define your models in the models.py file. In this example, we have a Tag model and …

Multiple Select with Django Forms Read More »

How to Use Github Workflow for Django Projects

Designing a GitHub workflow for CI/CD (Continuous Integration and Continuous Deployment) for a Django project involves creating a YAML configuration file that defines the steps to build, test, and deploy your Django application.In this tutorial we will explore a step-by-step guide on how to set up a GitHub workflow for a Django project: Create a …

How to Use Github Workflow for Django Projects Read More »

How to Track Page Views In Django Using Middleware

Application monitoring is an essential task when building and managing web applications. There exist several libraries and tools to monitor and track your application, however in this tutorial, we will see how to use Django’s build in middleware feature to track our page views. Tracking Page views Using Django Middleware A middleware in Django is …

How to Track Page Views In Django Using Middleware Read More »

How to Use Github Actions and Pytest For Your Python Project

Continuous Integration and Continuous Delivery and Deployment are essential principles in softwaredevelopment cycle. It has become the standard for every source version control hosting platform such as GitLab, Github, Azure Devops,etc to offer CI/CD pipelines in their platform. In this tutorial we will explore how to use Github Actions – a form of CI/CD workflow …

How to Use Github Actions and Pytest For Your Python Project Read More »

The Threats and Downsides of LLMs and ChatGPT

ChatGPT and LLMs(Large Language Models) are very useful information and search technologies.Unlike search engines,they do not just give information when queried they rather generate the written content.They offer several benefits such as below. It offers a conversational and interactive experience for retrieving information. It can be used for language translation and grammer correction It can …

The Threats and Downsides of LLMs and ChatGPT Read More »