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
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/
How to Iterate Over Rows in a Dataframe in Pandas

Pandas is a powerful library for working with data in Python, and the DataFrame is one of its most widely used data structures. One common task when working with DataFrames is to iterate over the rows and perform some action on each row.

Here are a few different approaches for iterating over rows in a DataFrame in Pandas:

1. Using …

Read: https://djangocentral.com/how-to-iterate-over-rows-in-a-dataframe-in-pandas/
How to Revert the Last Migration in Django

In Django, migrations are used to manage changes to the database schema, such as creating or modifying tables. Sometimes, you may need to revert the last migration to undo changes that were made to the database.

Here's how you can revert the last migration in Django.
Note- First, make sure that you have a backup of your database before making …

Read: https://djangocentral.com/how-to-revert-the-last-migration-in-django/
Understanding related_name in Django Models

In Django, related_nameis an attribute that can be used to specify the name of the reverse relation from the related model back to the model that defines the relation. It is used to specify the name of the attribute that will be used to access the related model from the reverse side of the relation.
This attribute is particularly …

Read: https://djangocentral.com/understanding-related-name-in-django-models/
Capturing Query Parameters of request.get in Django

In Django, the request object contains a variety of information about the current HTTP request, including the query parameters. Query parameters are a way to pass additional information in the URL and are used to filter or sort data.

The request object provides a convenient way to access query parameters through the GET attribute.
The GET attribute is a dictionary-like object …

Read: https://djangocentral.com/capturing-query-parameters-of-requestget-in-django/
A comparison of different Python web frameworks and when to use each one

Python is a versatile and powerful programming language that is widely used for web development. There are several web frameworks available for Python that can help developers build web applications quickly and easily. However, with so many options t...

Read: https://webwise.hashnode.dev/a-comparison-of-different-python-web-frameworks-and-when-to-use-each-one
Using htmx and Server-side DataTables.net together in a Django Project

Background
I really enjoy using htmx alongside Django, and try to help others when they're learning to combine these two tools. I often see questions online asking about how to combine htmx with DataTables (aka DataTables.net). Honestly, this threw m...

Read: https://til.jacklinke.com/using-htmx-and-server-side-datatables-net-together-in-a-django-project
Django Middlewares: Types and Custom Middleware

Middleware is a framework of hooks into Django's request/response processing. It is a light plugin system for altering Django’s input or output. Each middleware component is responsible for doing some specific function. You can use middleware if you ...

Read: https://bharat-phalak-blogs.hashnode.dev/django-middlewares-types-and-custom-middleware
A Step-by-Step Guide to the Django Rest Framework Tutorial

Overview of the Django Rest Framework
The Django Rest Framework (DRF) is a powerful and flexible toolkit for building Web APIs. It provides a full suite of features for developing RESTful APIs, including serialization, authentication, URL routing, an...

Read: https://sense.hashnode.dev/a-step-by-step-guide-to-the-django-rest-framework-tutorial
Elastic Search with Django Rest Framework

Objective: Adding a full-text search in Django Rest Framework using elastic search.
What is Elastic Search?
Elasticsearch is a distributed, open-source search and analytics engine designed for handling large volumes of data. It is built on top of the...

Read: https://sagaryadav17.hashnode.dev/elastic-search-with-django-rest-framework
Дайджест Python: итоги 2022 года, обзор версии 3.11 и курсы от Google

Дайджест интересных статей о Python: что нового в версии 3.11, гайды по программированию на Python и обучающие статьи.

Читать: «Дайджест Python: итоги 2022 года, обзор версии 3.11 и курсы от Google»
👍1🔥1🌚1
Understanding Models in Django

Django is a popular web framework for building web applications in Python. One of the key features of Django is its support for models, which allow developers to define the structure of the data that their applications will work with. In this blog po...

Read: https://nileshdarji.hashnode.dev/understanding-models-in-django
Testing and Modules

What are Unit tests and TDD?
Unit tests:
Unit tests are some pieces of code that exercise the input, the output, and the behavior of your code.
TDD tests:
Test-Driven Development is a strategy that entails first thinking about (and writing!) tests.

...

Read: https://sarahthedeveloper.hashnode.dev/testing-and-modules