Django Unleashed Framework
1.45K subscribers
2.18K photos
2.6K links
Лучшие материалы по разработке на фреймворке Django на русском и английском языке

Разместить рекламу: @tproger_sales_bot

Правила общения: https://tprg.ru/rules

Другие каналы: @tproger_channels

Другие наши проекты: https://tprg.ru/media
Download Telegram
Types of Errors in Django

While working with Django, we all have faced several types of errors. Let's have a quick look at some most common types of them.
P.S. There are many more types of them and the ones covered here are just the ones that I faced working with it till now....

Read: https://swap33377.hashnode.dev/types-of-errors-in-django
How We implemented Audit in our SaaS Django Platform

Context: what is Audit?
A while back with my team when working on a project we needed to add some audit features on the platform to be able to trace what happened in the app and show it to the end users and use it also for customer support requests, ...

Read: https://blog.adonissimo.com/how-we-implemented-audit-in-our-saas-django-platform
👍1
Maximizing Your Django Development: 6 Expert Tips

Django is a powerful web framework, but there are a few things you should keep in mind to make your work smoother and more effective. Here are the top tips that will make a difference in your Django project:
1. Use virtualenv
Virtualenv is a tool tha...

Read: https://sarahthedeveloper.hashnode.dev/maximizing-your-django-development-6-expert-tips
Using `.env` file in a Django Project

A .env file is a file that resides at the root of a Django project. It is used to store environment variables. Environment variables are stored in key-value pairs.
Sensitive information such as passwords, secret keys, client IDs, or API keys is advis...

Read: https://allthingstechie.hashnode.dev/using-env-file-in-a-django-project
Context Processors in Django

Introduction:
Django is a powerful web framework that follows the principles of the Don't Repeat Yourself (DRY) philosophy. One way that Django achieves this is through the use of Context Processors. In this article, we'll take a closer look at what ...

Read: https://sarahthedeveloper.hashnode.dev/context-processors-in-django
Creating App in Django

First of all, You need to set up the project if you have not done yet then check this article.
After creating a project your file structure will look like the below.
myproject
__init__.py
asgi.py
settings.py
urls.py
wsgi.py
manage...

Read: https://nileshdarji.hashnode.dev/creating-app-in-django
Writing Views in Django

In Django, a view is a Python function that takes a web request and returns a web response. The response can be in the form of HTML, JSON, XML, Image or anything at all. Yes anything
Below is a simple view that displays a message to the user
from dja...

Read: https://akolade.hashnode.dev/writing-views-in-django
Reducing queries for ForeignKeys in Django admin inlines

Speed up with raw_id_fields
ForeignKeys in the Django admin show as a select-box () by default. This will result in a query for every item in the select, only to get the name. This is not a problem if the model you're referencing will always ...

Read: https://deepintodjango.com/reducing-queries-for-foreignkeys-in-django-admin-inlines
Optimizing Database Queries in Django: A Guide to select_related and prefetch_related

In Django, select_related and prefetch_related are two functions that can be used to optimize database queries. They are particularly useful when working with foreign keys and many-to-many relationships, as they allow you to retrieve related objects ...

Read: https://blog.devjunction.in/optimizing-database-queries-in-django-a-guide-to-selectrelated-and-prefetchrelated
Creating a custom choice field for enums in Django REST Framework

The problem with ChoiceField
In Django REST Framework, there is a field called ChoiceField which can be used when you have certain choices for a field in your REST API. For example, let's imagine you were creating an API to convert colors to their re...

Read: https://blog.sarmad.ai/django-rest-framework-enum-choice-field
Outreachy: Week six

In case you are yet to follow my weekly publications, this article is the sixth of a series of articles detailing my Outreachy internship experience with Wagtail.
Last week, I shared with you three features I find interesting about the Wagtail Conten...

Read: https://activuscode.hashnode.dev/outreachy-week-six
How did I learn Django during my winter vacation?

After completing the first semester of undergrad, I had one and a half months of vacation. So, I was eager to utilize my free time in a productive way. Thus, I decided to learn Django during this time. Note: I already had a good experience in React J...

Read: https://prabeshbista.hashnode.dev/how-did-i-learn-django-during-my-winter-vacation
Why we migrated from Flask to Dango

This article is not about the differences between Django and Flask. Each one has its own advantages and disadvantages. This is the story of our migration.
We built the PoC with Flask. We were happy. Flask is an easy framework to start with. You only ...

Read: https://emremert.dev/why-we-migrated-from-flask-to-dango
Day 8 - Strings

What are strings?
In python, anything that you enclose between single or double quotation marks is considered a string. A string is essentially a sequence or array of textual data. Strings are used when working with Unicode characters.
Example
name =...

Read: https://viveky.hashnode.dev/day-8-strings
Render HTML template in Django

In the previous article, we talked about the views in which we are returning the HTTP response. Now let's see how to render an HTML file as a response.
First of all, you have to change setting.py . Set DIRS option in the templates setting to the dire...

Read: https://nileshdarji.hashnode.dev/django-tutorial-3
Django Authentication using an Email Address

Django's built-in User model uses a username as the primary means of identifying a user. However, you may want to use an email for authentication for your web application.

In this article, we will show you how to configure Django to use an email address as the primary means of identifying a user when they log in.
Considering the scope of the …

Read: https://djangocentral.com/authentication-using-an-email-address/
How To Create Custom Context Processors in Django

Django provides a convenient way to add extra data to the context of a template through context processors. These context processors can be used to display information such as the current user, site-wide settings, or even data that is fetched from the database.
With a few lines of code, you can create your own custom context processors and make them available …

Read: https://djangocentral.com/how-to-create-custom-context-processors-in-django/
Creating Custom Exception in Django Rest Framework

Django Rest Framework (DRF) provides built-in exception handling that can be used to handle errors and exceptions in a RESTful API.

However, in some cases, you may need to create a custom exception to handle specific error scenarios.

Here's how you can create a custom exception in DRF.

Creating Custom API Exception
Create a new file in your Django …

Read: https://djangocentral.com/creating-custom-exception-in-django-rest-framework/
Django automated deployments to Digital ocean using GitHub actions

In this article, you will learn how to build an automated GitHub actions pipeline that deploys a Django application to a digital ocean droplet.
Prerequisites:

A GitHub account.

A docker hub account.

A digital ocean account.


1 Base application.
F...

Read: https://blog.kipchirchirlangat.com/django-automated-deployments-to-digital-ocean-using-github-actions
A Comprehensive Beginner’s Guide to Learning Django Web Development

Introduction: What is Django and How it Can Help Web Developers?
Django is a free and open-source web application framework written in the Python programming language. It is designed to help developers create complex, database-backed web applications...

Read: https://sense.hashnode.dev/a-comprehensive-beginners-guide-to-learning-django-web-development
How to Check if a File Exists With Python

Checking if a file exists is a common task in while working with files. There are several ways to check if a file exists without raising an unwanted exception, each with its own advantages and disadvantages.

Here are a few different approaches.

1. Using the os.path.exists()function

This method uses the os.pathmodule to check if …

Read: https://djangocentral.com/how-to-check-if-a-file-exists-with-python/