Practical solutions

Django Howto's How-To Guides

Solve the problem. Keep building. Collection of Python Django how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Log Messages to the Console in DjangoLearn how to log messages to the console in Django How to Convert a QuerySet to a JSON in DjangoLearn how to convert a QuerySet to a JSON in Django How to Integrate Ajax With Django in PythonThe purpose of this article is to demonstrate what is Ajax and how to integrate Ajax with Django and see how to send Ajax get and post requests from a browser and how to handle the data on the Django site in Python. How to Slug in DjangoThis demonstration aims to define a slug and how we can use the slug field to get a unique post with Django in Python. How to Filter Items From Query Set in Descending Order in DjangoIn this explanation, learn how to filter out the items of the query set in descending order with the help of the order_by() method in Django. How to Avoid Creating Duplicate Objects in DjangoThe main purpose of this article is to learn about the get_or_create() method in Django. It is a method used to avoid redundant fields in our query set. How to Use Post Request to Send Data to a Django ServerIn this explanation about Django, we have a short introduction about the post and get requests and how to implement the CSRF token with the post in Django. How to Upload Media in DjangoIn this article, we have a short introduction about the media files and how we can operate media files in the Django project. How to Return JSON in DjangoIn this discussion with us we have a look at a short introduction to JSON format and we discuss how to return data into JSON format with the help of JsonResponse class in Django. How to Create Objects in DjangoThe purpose of this article is to explain what is a model and how to create objects using the create() method and see how to work the save() method in Django. How to Create Field for Multiple Choices in DjangoIn this article, we will look at making a field for multiple choices and show you how to allow users to select multiple choices in Django. How to Check if Object Exists in DjangoIn this explanation of the common issue you see how to check if an object exists in the model and you also learn how to handle exceptions to show the convenient error to the user. How to Download File in DjangoIn this article we will learn how to create a website where the admin can upload a file and we also learn how to make the user download a file from a web page in Django. How to Use jQuery in a Django AppThis article discusses a short introduction to jQuery. This also tackles how to connect jQuery with a Django app. How to Use Dynamic URL Inside the Template in DjangoWe will learn, with this explanation, how to use the url tag in templates and how to add links inside the templates in Django. How to Change Password in DjangoWe will learn with this explanation about how we create a webpage for the user to change the password after login on the webpage in Django. How to Manipulate Raw Queries in DjangoWe will learn, with this explanation, what the raw() method does and how we can manipulate raw queries. We will also learn how to inject SQL within our applications in Django. How to Import Settings in DjangoThis article will teach us to import custom settings in the Django app. Django ALLOWED_HOSTSThis article shows how to take your Django website, get it ready for public release, how to set ALLOWED_HOSTS and how to fix expected major issues during web deployment with Django. Django ArrayFieldIn this article, we will learn to use the ArrayFields inside the Django database models. Django BootstrapThe main goal of this brief explanation is to learn how to add Bootstrap to the project in Django and we also have a look at some configurations about static asserts. Select_related Method in DjangoThe article demonstrates what the query set is, how to work these queries and how we can utilize the select_related() method to filter the query of the related model in Django. Function of On_delete Parameter in Django ModelsLearn about the function of on_delete parameter in Django Models Meta Class in Django ModelsLearn about the role of the Meta Class in Django Models.