Articles on Trending Technologies

Technical articles with clear explanations and examples

Django model object hit counting

Ath Tripathi
Ath Tripathi
Updated on 26-Mar-2026 540 Views

In this article, we will create a Django project that tracks and stores hit count data for model objects. This functionality helps generate useful analytics reports by monitoring page views and user interactions. Installation and Setup First, install the django-hitcount module using pip ? pip install django-hitcount In your settings.py file, add the hitcount app to your installed apps ? INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', ...

Read More

Django – Admin based File Management

Ath Tripathi
Ath Tripathi
Updated on 26-Mar-2026 1K+ Views

Django's admin panel can be enhanced with django-filer to provide comprehensive file management capabilities. This allows administrators to upload, organize, and manage various file types directly from the admin interface. Installing Django-Filer First, install the required package using pip ? pip install django-filer Configuration Add the necessary apps and configuration to your settings.py file ? INSTALLED_APPS = [ ... 'easy_thumbnails', 'filer', 'mptt', ... ] THUMBNAIL_HIGH_RESOLUTION = True THUMBNAIL_PROCESSORS = ...

Read More

Creating a screenshot taking website in Django

Ath Tripathi
Ath Tripathi
Updated on 26-Mar-2026 944 Views

In this article, we will create a Django website that captures screenshots of your screen. When you click "Take Screenshot", it saves the image to the media folder and displays it on the webpage. Setting up the Django Project First, create a Django project and app. In settings.py, add your app name to INSTALLED_APPS and configure media settings − MEDIA_URL = '/media/' MEDIA_ROOT = BASE_DIR / 'media' This sets up the media folder for image storage. URL Configuration In your project's urls.py − from django.contrib import admin from django.urls import ...

Read More

Client side image zooming and rotating in Django

Ath Tripathi
Ath Tripathi
Updated on 26-Mar-2026 746 Views

Client-side image manipulation allows users to zoom and rotate images before uploading in Django applications. The django-client-side-image-cropping library provides jQuery-powered zooming and rotating functionality that works directly in the browser. Installation and Setup Create a Django project and app, then configure basic settings. Install the required library ? pip install django-client-side-image-cropping Add the library to your INSTALLED_APPS in settings.py ? INSTALLED_APPS += ['client_side_image_cropping'] Model Configuration Create a simple model with an image field in models.py ? from django.db import models class Data(models.Model): ...

Read More

Adding translation to a model instance in Django

Ath Tripathi
Ath Tripathi
Updated on 26-Mar-2026 356 Views

In this article, we are going to learn how to create a translation for any model instance in Django. Sometimes, you may need to save data like names, descriptions, or text content that must be rendered in different languages. Instead of complex database management, we'll use django-klingon to achieve this with minimal setup. We'll focus on settings.py, models.py, and admin.py to implement multilingual support for Django model fields. Installation and Setup First, install the django-klingon package ? pip install django-klingon In settings.py, add the following configuration ? INSTALLED_APPS += ['klingon'] KLINGON_DEFAULT_LANGUAGE ...

Read More

How to add a Money field in Django?

Ath Tripathi
Ath Tripathi
Updated on 26-Mar-2026 2K+ Views

Django's default IntegerField and DecimalField don't handle currency properly for financial applications. The django-money library provides a MoneyField that handles currency symbols, decimal precision, and multi-currency support. Installation and Setup First, install the django-money package − pip install django-money Add it to your Django project's settings.py − INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'djmoney', # Add this line ...

Read More

Adding JSON field in Django models

Ath Tripathi
Ath Tripathi
Updated on 26-Mar-2026 16K+ Views

In this article, we will see how to add JSON fields to our Django models. JSON is a simple format to store data in key-value pairs using curly braces. JSON fields are particularly useful when you need to store flexible, unstructured data like user preferences, metadata, or configuration settings. First, create a Django project and an app. Make sure to add your app to INSTALLED_APPS, set up URLs, and configure your basic project structure. Modern Approach (Django 3.1+) Django 3.1 and later versions include native JSON field support, eliminating the need for third-party packages ? ...

Read More

How to add extra security to Django admin using fake admin login?

Ath Tripathi
Ath Tripathi
Updated on 26-Mar-2026 440 Views

Adding extra security to Django admin can be achieved using a fake admin login page. This technique creates a "honeypot" that logs unauthorized access attempts while hiding the real admin interface on a secret URL. The django-admin-honeypot package creates a fake Django admin page that captures login attempts with IP addresses, regardless of whether correct or incorrect credentials are used. Installation First, install the required package ? pip install django-admin-honeypot Configuration Settings Configuration Add the honeypot app to your INSTALLED_APPS in settings.py ? INSTALLED_APPS = [ ...

Read More

How to add Django debug toolbar to your project?

Ath Tripathi
Ath Tripathi
Updated on 26-Mar-2026 3K+ Views

The Django Debug Toolbar is a powerful debugging tool that displays detailed information about database queries, request/response data, templates, and performance metrics. It's essential for optimizing Django applications during development. Installation First, install the django-debug-toolbar package using pip − pip install django-debug-toolbar Configuration Steps Step 1: Add to INSTALLED_APPS Add 'debug_toolbar' to your INSTALLED_APPS in settings.py − INSTALLED_APPS = [ # ... 'debug_toolbar', 'myapp' ] Step 2: Configure Middleware Add the debug toolbar middleware to ...

Read More

How to create a 100% stacked Area Chart with Matplotlib?

Rishikesh Kumar Rishi
Rishikesh Kumar Rishi
Updated on 26-Mar-2026 1K+ Views

A 100% stacked area chart displays data as percentages of the total, where each area shows the relative contribution of each category. In Matplotlib, we use stackplot() with percentage-normalized data to create this visualization. Understanding 100% Stacked Area Charts Unlike regular stacked area charts that show absolute values, a 100% stacked chart normalizes all values to percentages, making it easier to compare proportional relationships over time. Creating a 100% Stacked Area Chart Here's how to create a 100% stacked area chart showing world population distribution by continent ? import matplotlib.pyplot as plt import numpy ...

Read More
Showing 4011–4020 of 61,297 articles
« Prev 1 400 401 402 403 404 6130 Next »
Advertisements