Django

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 »

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 Copy Table Data To Clipboard in Django with JavaScript

In this tutorial we will explore a two methods for creating a table where bywe can click on each row and copy the data to clipboard respectively.This is quite useful when you want to add copy row data instead of the entire table. Let us see how to do that. Designing the Table We will …

How to Copy Table Data To Clipboard in Django with JavaScript Read More »

Deploying Django with Gunicorn,Nginx & Supervisor

In this tutorial we will explore how to deploy our django project to a production server. Below are the general steps. Serving Django Project with gunicorn Setup nginx conf in /etc/nginx/sites-available/myproject.conf Create a symbolic link in /etc/nginx/sites-enabled Restart nginx to see 501 Create a myproject.supervisor.conf file in /supervisor/conf.d/ directory Run supervisorctl Using Gunicorn to Serve …

Deploying Django with Gunicorn,Nginx & Supervisor Read More »

Monitoring Django App with Azure Application Insights

Monitoring Django Applications with Azure App Insights Application Insights is an application performance monitoring(APM) service developed by Microsoft Azure.It is quite useful for monitoring both server side and client side applications built with dotnet,nodejs,java and also python.In this tutorial we will explore how to monitor your django apps and project using App Insights(AI for short). …

Monitoring Django App with Azure Application Insights Read More »