Ath Tripathi

Ath Tripathi

74 Articles Published

Articles by Ath Tripathi

74 articles

Getting POST request IP address in Django

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

In Django web applications, tracking the IP address of POST requests is essential for security monitoring, rate limiting, and access control. The django-ipware package provides a reliable way to extract client IP addresses from HTTP requests. Installation First, install the django-ipware package using pip ? pip install django-ipware No additional configuration is required after installation. Creating the HTML Template Create a simple HTML form in templates/home.html to test POST requests ? IP Address Tracker ...

Read More

Using djoser in Django for token authentication without views

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

Djoser is a Django REST authentication library that simplifies token-based authentication. It provides ready-to-use endpoints for user registration, login, and token generation without requiring custom views. Installation First, create a Django project and install the required packages ? pip install djoser pip install djangorestframework Django Settings Configuration Add the required apps and authentication settings to your settings.py ? INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ...

Read More

How to add Social Share buttons in Django?

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

Social share buttons are essential for modern websites, allowing users to share content across platforms like Facebook, Twitter, and LinkedIn. Django provides an easy way to implement these features using the django-social-share package. Installation First, install the required package ? pip install django-social-share Project Setup Configure Settings Add the package to your Django settings ? # settings.py INSTALLED_APPS += ['django_social_share'] URL Configuration Set up the main project URLs ? # project/urls.py from django.contrib import admin from django.urls import path, include urlpatterns = [ ...

Read More

Smooth profiling in Django

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

In this article, we are going to implement Django profiling using django-silk. This tool provides detailed information about your application's performance, including GET requests, database queries, and other essential metrics for monitoring your website in production environments. Django Silk is particularly valuable for real-world project deployments where performance monitoring is critical. Installation First, create a Django project and app with basic settings configured. Then install the django-silk package ? pip install django-silk Configuration Settings Configuration In your settings.py, add the following configuration ? MIDDLEWARE = [ ...

Read More

Django – Showing model data directly into table with sorting and pagination

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

In this article, we will see how to make a table in Django which will render model data. We are not going to use the standard tag of HTML. We will use the django_tables2 library which provides features to directly show Django model data in a table with sorting and pagination. Installing django_tables2 First, install the django_tables2 package ? pip install django_tables2 Add it to your settings.py ? INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', ...

Read More

QR code generating website in Django

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

We sometimes need to generate QR codes for URLs in our Django websites. QR codes are scanned for verification, website login, opening websites and many other purposes. In this article, we will see how to implement a QR code generator website in Django. Setting Up the Django Project First, create a Django project and an app. Create a media folder at the same level as your project and app directories. Go to settings.py in the project folder and add the app name in INSTALLED_APPS and add this at the bottom − MEDIA_ROOT = os.path.join(BASE_DIR, 'media/') ...

Read More

Model object's history tracking in Django

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

Model history tracking in Django allows you to track changes made to model objects, including what changes were made, when they occurred, and helps in recovery of deleted objects. The django-simple-history package provides an easy way to implement this functionality. Installation and Setup First, install the django-simple-history library ? pip install django-simple-history Add the package to your Django settings in settings.py ? INSTALLED_APPS = [ # other apps 'simple_history', ] MIDDLEWARE = [ # other middleware ...

Read More

How to add an UpdateView in Django?

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

Django's UpdateView is a built-in class-based view that simplifies updating model data from the frontend. It acts like an admin interface for editing existing records. In this tutorial, we'll create a complete example demonstrating how to implement UpdateView for a Student model. Project Setup First, create a Django project and app. Add the app to your settings and configure URLs ? settings.py INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ...

Read More

How to add a text editor field in Django?

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

Many online exam platforms and content management systems use rich text editors for text entries, image uploading, and formatted content creation. Quill is a popular WYSIWYG text editor that provides a Django model field to directly store rich content in the database without extra configuration. In this article, we will see how to implement a rich text editor field in Django using django-quill-editor. Installation and Setup First, create a Django project and app with basic configuration. Install the django-quill-editor package ? pip install django-quill-editor In settings.py, add the required configuration ? ...

Read More

Making your own custom filter tags in Django

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

Django provides many built-in template filters, but you can also create custom filters to extend functionality. Custom filters allow you to process data in templates using your own logic, such as formatting text or performing calculations. In this article, we will learn how to create and use custom template filters in Django. Project Setup First, create a Django project and app with the following structure ? tutorial/ (project) ├── example/ (app) │ ├── templates/ │ │ └── home.html │ ...

Read More
Showing 1–10 of 74 articles
« Prev 1 2 3 4 5 8 Next »
Advertisements