What is on_delete Attribute in Django Models

Django Web Framework Tutorials

Django, a popular Python web framework, simplifies the process of building database-backed web applications. When defining models in Django, you often come across fields that involve relationships between different models. The on_delete attribute plays a vital role in these relationships, allowing you to specify what should happen when a related object is deleted.. In this … Read more

How to Safely Revert/Undo Last Migration in Django

Django’s migration system is powerful tool for managing your database schema changes over time. However, there are situations where you may need to revert or undo the last migration due to issues or changes in your application requirements. In this blog, we will explore how to revert last migration in Django, complete with examples to … Read more

Combining Multiple QuerySets in Django with Examples

Django Web Framework Tutorials

In Django, working with QuerySets is a fundamental aspect of database interaction. Sometimes, you may need to combine multiple QuerySets into one to create a unified and comprehensive result, in this blog, we will explore various techniques for combining QuerySets in Django, along with practical examples. Using union() The union() method in Django allows you … Read more

Filter Django Queryset with Not Equal with Examples

Django Querysets offer a robust mechanism for filtering and fetching data from databases. A frequent filtering necessity involves retrieving records that do not match a specific value. In this blog, we’ll delve into performing “not equal” filtering within Django Querysets, demonstrating various approaches through practical examples. By exploring Django’s filter not equal functionality, Django not … Read more

Difference Between null=True and blank=True in Django Models

Django Web Framework Tutorials

Django, a popular Python web framework, offers powerful tools for building robust and flexible database-backed web applications. When defining models in Django, developers often encounter two common field options: null=True and blank=True. These options seem similar at first glance but serve different purposes. In this blog, we’ll learn difference between null=True and blank=True in Django … Read more

Can Django Serve 100K Daily Visits? Explore Scalability and Performance

Django Web Framework Tutorials

Django, a high-level Python web framework, is renowned for its simplicity, robustness, and developer-friendly features. It empowers developers to create web applications quickly and efficiently. However, as your application grows and attracts a larger user base, you might wonder if Django can handle traffic generated by 100,000 daily visits. In this blog, we’ll explore the … Read more

gitignore File for Django and Django Rest Framework

Django Web Framework Tutorials

Django and Django Rest Framework (DRF) are powerful tools for building web applications and RESTful APIs in Python. When working on Django and DRF projects, it’s crucial to manage your codebase efficiently and keep sensitive or unnecessary files out of your Git repository. This is where the .gitignore file comes into play.. In this blog, … Read more

Add Github Login to Django Website using django-allauth

Django Web Framework Tutorials

In today’s world of web development, user authentication is a critical aspect of creating secure and user-friendly applications. Integrating third-party authentication providers, such as GitHub, can simplify the login process for users and enhance the security of your Django website. In this tutorial, we will guide you through the process of adding GitHub login to … Read more

Add Facebook Login to Django Website using django-allauth

Django Web Framework Tutorials

In today’s interconnected world, user authentication is a vital component of web development. Integrating third-party authentication providers like Facebook can enhance user convenience and streamline the registration process for your Django website. In this tutorial, we’ll guide you through the process of adding Facebook login to your Django project with a practical example. Prerequisites: Let’s … Read more

Login with OTP via Email/Phone in Django

Django Web Framework Tutorials

Adding OTP (One-Time Password) authentication via email or phone to your Django application is a valuable feature for enhancing security. In this modified version of the blog, I’ll guide you through the process of adding OTP-based login using email. You can adapt the same principles for phone-based OTP authentication as needed. This is extended project … Read more

How to Create RBAC in Django with Multiple Users Types

Django Web Framework Tutorials

Role-Based Access Control (RBAC) is a crucial aspect of building secure and scalable web applications. In Django, RBAC can be implemented to manage user permissions effectively. In this blog post, we’ll walk you through the process of creating RBAC in Django using a practical example: an attendance system with three user types – admin, manager, … Read more

Use Multiple Databases in One Django Project: MySQL, Postgres & SQLite

Django Web Framework Tutorials

Django is a versatile web framework that allows developers to work with multiple databases in a single project. In this blog, we’ll explore how to set up and use multiple databases, including SQLite, MySQL, and PostgreSQL, in a Django project.. We’ll provide a step-by-step guide along with practical examples to help you understand the process. … Read more

Import Data from CSV Sheets into Databases using Django

Django Web Framework Tutorials

Django, a powerful Python web framework, offers an efficient way to import data from CSV (Comma-Separated Values) sheets into your database. Whether you’re migrating existing data or regularly updating your application’s database, this guide will walk you through the process step by step. Prerequisites Before we dive into the implementation, make sure you have the … Read more

How to Extend Django User Model using Proxy Models

Django Web Framework Tutorials

Django’s User model provides a solid foundation for authentication, but as projects grow, additional user-specific attributes may be necessary. Extending the User model via proxy models offers a unique approach to customization. In this blog, we’ll explore how to extend Django User Model using the Proxy Model method, supported by a comprehensive example. Understanding Proxy … Read more

How to Extend Django User Model using One-to-One Link

Django Web Framework Tutorials

Django’s User model provides essential authentication features, but many projects require additional user-related information. Extending the User model through a one-to-one link model offers a flexible approach. In this blog, we’ll explore how to extend Django User Model using the One-to-One Link Model method, supported by a practical example. Understanding One-to-One Link Model By creating … Read more

How to Extend Django User Model using AbstractUser

Django Web Framework Tutorials

Django, a powerful Python web framework, offers a built-in User model for authentication purposes. However, when your project demands additional user-specific information, extending the User model becomes essential. In this blog, we’ll explore how to extend Django User Model using the AbstractUser method, accompanied by a comprehensive example. Understanding AbstractUser The AbstractUser class in Django’s … Read more

How to Extend Django User Model using AbstractBaseUser

Django Web Framework Tutorials

Django, a high-level Python web framework, provides a robust User model for authentication and user management. However, many projects require extending the default User model to accommodate additional user-specific attributes and behaviors. In this blog, we’ll explore the method of extending Django User Model using AbstractBaseUser and walk through a detailed example. Understanding AbstractBaseUser The … Read more

Custom Throttling in Django Rest Framework: API Rate Limits to Your Needs

Django Web Framework Tutorials

Rate limiting is a cornerstone of maintaining API performance and protecting server resources. In Django Rest Framework (DRF), you have the flexibility to create your own throttling classes, known as custom throttling. In this blog, we’ll explore the power of custom throttling, delve into its practical applications, and guide you through a comprehensive example to … Read more

YAML, XML, JSON Response Renderer in Django Rest Framework

Django Web Framework Tutorials

In Django Rest Framework (DRF), the ability to generate responses in different formats, such as YAML, XML, and JSON, plays a pivotal role in creating versatile APIs. These response renderers allow you to tailor your API outputs to match varying client preferences. In this comprehensive blog post, we’ll explore the YAMLRenderer, XMLRenderer, and JSONRenderer in … Read more