Django pre_save Signal

django signals pre_save

When working with Django, you may need to run custom logic immediately before a model instance is saved to the database. I’ve found Django’s pre_save signal to be a useful tool for this. It allows you to hook into the save process and perform actions such as data validation, auto-populating fields, or even preventing a … Read more >>

How to Run Python Scripts in Django?

django runscript

I’ve often needed to integrate standalone Python scripts into Django projects. Whether it’s for data processing, automation, or backend tasks, running Python scripts inside Django can be tricky if you’re not familiar with the best approaches. In this article, I’ll walk you through different methods to run Python scripts within a Django application. I’ll share … Read more >>

Round Numbers to Two Decimal Places in Python Django

django template round

Handling decimal places was a common challenge, especially when dealing with financial or scientific data. Rounding numbers accurately to two decimal places is necessary in many real-world applications, such as displaying prices, calculating taxes, or formatting user inputs. In this article, I will share practical methods I’ve used over the years to round numbers to … Read more >>

Concatenate Strings in Python Django

django concat

One common task I encounter across projects is string concatenation, combining multiple strings into one. Whether you’re building dynamic URLs, crafting user messages, or formatting data for templates, knowing how to concatenate strings efficiently in Django is essential. In this article, I’ll walk you through several simple methods to concatenate strings in Python Django. These … Read more >>

Password Encryption and Decryption in Django

django password decryption

Django provides useful tools for password management. However, sometimes you need to go beyond Django’s default hashing mechanisms, especially when you want to encrypt and decrypt passwords or sensitive data for specific use cases. In this tutorial, I’ll walk you through practical methods to encrypt and decrypt passwords in Django. I’ll share code examples and … Read more >>

Python Django Form Validation

django form validation

Django offers useful tools to handle form validation efficiently. In this article, I’ll walk you through the essentials of Django form validation. We’ll cover built-in validation methods, custom validation techniques, and how to handle errors gracefully. I’ll also share some practical examples that reflect real-world scenarios, especially relevant for developers working on applications. Let’s get … Read more >>

Generate Random Numbers in Python Django

django random

I’ve often found myself needing to generate random numbers in Django applications. Python’s built-in random module makes this task simple, and integrating it within Django views or models is simple once you understand the basics. In this article, I’ll walk you through different ways to generate random numbers in Django, sharing practical examples that you … Read more >>

How to Format Dates in Python Django

django date format ddmmyyyy

I’ve often found that handling dates and times in Django projects is a common yet sometimes tricky task. Formatting dates to display them properly on your website is essential for user experience, especially when your audience is in the USA, where date formats differ from other regions. In this article, I’ll share practical methods to … Read more >>

Get All Data from a POST Request in Django

django redirect with post data

Working with POST requests in Django is something I do daily as a Python developer with over ten years of experience. Handling form submissions, APIs, or any client data sent via POST is a fundamental part of building web applications. Yet, I often see beginners struggle to get all the data from a POST request … Read more >>

51 Python Programs

51 PYTHON PROGRAMS PDF FREE

Download a FREE PDF (112 Pages) Containing 51 Useful Python Programs.

pyython developer roadmap

Aspiring to be a Python developer?

Download a FREE PDF on how to become a Python developer.

Let’s be friends

Be the first to know about sales and special discounts.