Programming Articles

Page 25 of 2547

Importing data into models in Django

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

In this article, we will learn how to import data from JSON format into Django models. Django supports importing data from various formats including JSON, CSV, XLSX, and YAML using the django-import-export package. We'll create a Django project with a simple model and configure it to accept imported data through the admin interface. Setup Requirements First, install the required package ? pip install django-import-export Add the package to your Django project's INSTALLED_APPS in settings.py ? INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', ...

Read More

Implementing models reversion in Django

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

In this article, we will learn how to implement django-reversion for tracking model changes, recovering deleted data, and maintaining version history of Django model objects. Django reversion provides powerful data recovery capabilities and complete object tracking. Setup and Installation First, create a Django project and app, then install the required package − pip install django-reversion Add reversion to your INSTALLED_APPS in settings.py − INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', ...

Read More

How to make any Django model's file downloadable?

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

You can use the django-downloadview package to make any file in your Django model downloadable. This package provides a simple way to serve files while handling security and performance considerations. In this article, we will see how to make a file downloadable in our Django project using django-downloadview. Installation First, install the package using pip: pip install django-downloadview Now create a Django project and an app. Set up urls and add the app in INSTALLED_APPS. Also set up MEDIA_ROOT and MEDIA_URL in settings.py. Creating the Model In models.py, create a model ...

Read More

How to implement django-material in your Django project?

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

Django-material is a library that applies Google's Material Design styling to Django forms without requiring external CDNs. It automatically transforms your standard Django form widgets into beautiful, Material Design-styled components. Installation First, install the django-material package using pip ? pip install django-material Configuration Add 'material' to your INSTALLED_APPS in settings.py ? INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'material', # ...

Read More

Django – Handling multiple forms in single view

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

In Django web development, you often need to handle multiple forms within a single view. This article demonstrates how to create a function that manages two forms simultaneously using Django's MultiModelFormView. Project Setup Create a Django project and app. For this example, we'll use "multipleFormHandle" as the project name and "formhandlingapp" as the app name. Complete the basic setup by including the app in settings.py INSTALLED_APPS and adding the app's URL to the project's main URL configuration. Create forms.py in the app directory and a "templates" folder containing home.html. Install the required library ? ...

Read More

Google Authentication in Django

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

Google Authentication allows users to log into your Django application using their Google accounts. This article demonstrates how to implement Google social authentication using Django Allauth library. Setting Up Google OAuth Credentials First, configure Google OAuth credentials in Google Cloud Console ? Go to Google Cloud Console and create a project. Navigate to OAuth consent screen and create a consent screen. Go to Credentials and click "Create Credentials" → "OAuth client ID". Select "Web application" and add these URLs: http://127.0.0.1:8000/ http://127.0.0.1:8000/accounts/google/login/callback/ Save the generated Client ID and Client Secret for later ...

Read More

Enabling GitHub OAuth in Django

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

Django allows integration with GitHub OAuth for user authentication, making it easy for users to log in using their GitHub credentials. This tutorial demonstrates how to implement GitHub OAuth in a Django application using the django-allauth library. Setting Up GitHub OAuth Application First, create a GitHub OAuth application: Go to GitHub Developer Settings Create a new OAuth App with these URLs: Homepage URL: http://127.0.0.1:8000/ Authorization callback URL: http://127.0.0.1:8000/accounts/github/login/callback/ Save the Client ID and Client Secret ...

Read More

Exporting models data in Django

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

In this article, we will see how to export model data in .csv format. Sometimes, you might need to export your model data in different formats such as .csv, json, or .xlsx for further work or reporting. Django provides an elegant solution using the django-import-export package. We will create a Django project with a simple model and configure it to enable data export functionality through the Django admin interface. Installation and Setup First, install the required package − pip install django-import-export Add the library to your project's INSTALLED_APPS in settings.py − ...

Read More

Django runtime system check

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

When creating a Django website, you sometimes need a URL endpoint to monitor your database, cache, and storage systems. The django-watchman package provides runtime system checks that help you monitor your application's health in both development and production environments. In this article, we'll create a URL endpoint that provides comprehensive system health checks for your Django application. Installation First, install the django-watchman package using pip ? pip install django-watchman Configuration Adding to INSTALLED_APPS In your settings.py file, add watchman to your installed apps ? INSTALLED_APPS = [ ...

Read More

Django rest-framework JWT authentication

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

Django REST Framework JWT authentication provides a secure token-based authentication system using JSON Web Tokens. JWT tokens contain encoded user information and are ideal for stateless authentication in API applications. Installation First, install the required packages ? pip install djangorestframework-simplejwt pip install djangorestframework Configuration Settings Configuration In settings.py, add the following configuration ? INSTALLED_APPS = [ # ... other apps 'rest_framework', 'rest_framework_simplejwt', # ... other apps ] REST_FRAMEWORK = { ...

Read More
Showing 241–250 of 25,469 articles
« Prev 1 23 24 25 26 27 2547 Next »
Advertisements