Lathkar Malhar / Латкар Малхар - Modern Django Web Development / Современная веб-разработка на Django [2025, PDF, ENG]

Страницы:  1
Ответить
 

tsurijin

Стаж: 5 лет

Сообщений: 2971


tsurijin · 15-Июл-25 10:48 (4 месяца 20 дней назад)

Modern Django Web Development / Современная веб-разработка на Django
Год издания: 2025
Автор: Lathkar Malhar / Латкар Малхар
Издательство: Apress Media LLC
ISBN: 979-8-8688-1472-3
Язык: Английский
Формат: PDF
Качество: Издательский макет или текст (eBook)
Количество страниц: 441
Описание: Django has evolved into a powerful full-stack framework ideal for developing data-driven web applications, continuously expanding with new tools for asynchronous solutions, APIs, and real-time applications. This book explores modern Django development best practices, including Django Channels for WebSockets, Django REST Framework (DRF) for REST APIs, Graphene and Strawberry for GraphQL APIs, and integrating a front-end built with React The content is structured into two main parts, covering both fundamental and advanced concepts in a practical and digestible manner.
The first part introduces Django's core concepts, starting with an overview of web development and Python’s asyncio module for asynchronous processing. It then walks you through Django installation, project setup, and the admin interface. The Model-View-Template (MVT) architecture is explained in depth, with chapters on models, views, and templates, illustrating real-world examples. Additionally, it covers database interactions, introducing SQLAlchemy ORM and MongoDB integration to extend Django’s capabilities beyond its default ORM.
The second part delves into advanced Django features and the broader ecosystem. Topics include authentication, security, messaging, and reusable apps such as the Django toolbar. REST API development with Django REST Framework is explored, followed by an introduction to building GraphQL APIs using Graphene and Strawberry. A dedicated chapter covers Django Channels and the WebSocket protocol for real-time applications. Modern Django Web Development concludes with integrating React to develop front-end clients for Django-based REST, GraphQL, and WebSocket APIs, enabling a full-stack development experience.
You Will:
Explore the full spectrum of modern Django development
Learn how to use SQLAlchemy MongoDB with Django
Understand Django Channels for asynchronous web apps
Explore DRF for building REST API in Django
Learn how to build GraphQL API with Graphene and Strawberry
Understand how to develop a Django-React app
Who is it for:
Software developers, web developers and engineers who are interested in adding Django to their development skillset. Python Developers can also leverage the power of modern Django with the help of this practical guide.
Django превратился в мощный полнофункциональный фреймворк, идеально подходящий для разработки веб-приложений, управляемых данными, и постоянно расширяющийся новыми инструментами для асинхронных решений, API и приложений реального времени. В этой книге рассматриваются современные передовые методы разработки на Django, в том числе Django Channels для WebSockets, Django REST Framework (DRF) для REST API, Graphene и Strawberry для GraphQL API, а также интеграция интерфейса, созданного с помощью React. Содержание структурировано на две основные части, охватывающие как фундаментальные, так и продвинутые концепции в практическом и удобоваримым образом.
В первой части представлены основные концепции Django, начиная с обзора веб-разработки и модуля asyncio на Python для асинхронной обработки. Затем вы познакомитесь с установкой Django, настройкой проекта и интерфейсом администратора. Подробно описана архитектура Model-View-Template (MVT), в главах, посвященных моделям, представлениям и шаблонам, приведены примеры из реального мира. Кроме того, он охватывает взаимодействие с базами данных, внедряя интеграцию SQLAlchemy ORM и MongoDB для расширения возможностей Django за пределы ORM по умолчанию.
Вторая часть посвящена расширенным возможностям Django и экосистеме в целом. Темы включают аутентификацию, безопасность, обмен сообщениями и приложения многократного использования, такие как панель инструментов Django. Рассматривается разработка REST API с использованием платформы Django REST Framework, а затем дается введение в создание GraphQL API с использованием Graphene и Strawberry. В отдельной главе рассматриваются каналы Django и протокол WebSocket для приложений реального времени. Современная веб-разработка на Django завершается интеграцией React для разработки интерфейсных клиентов для REST, GraphQL и WebSocket API на базе Django, что обеспечивает возможность разработки в полном объеме.
Вы будете:
Изучите весь спектр современных возможностей разработки на Django
Узнайте, как использовать SQLAlchemy MongoDB с Django
Разберитесь в каналах Django для асинхронных веб-приложений
Изучите DRF для создания REST API в Django
Узнайте, как создавать GraphQL API с помощью Graphene и Strawberry
Поймите, как разрабатывать приложение на основе Django-React
Для кого это:
Разработчики программного обеспечения, веб-разработчики и инженеры, которые заинтересованы в том, чтобы добавить Django в свой набор навыков разработки. Разработчики на Python также могут использовать возможности современного Django с помощью этого практического руководства.
Примеры страниц (скриншоты)
Оглавление
About the Author ...................................................................................................xiii
About the Technical Reviewer ..................................................................................xv
Acknowledgments ..................................................................................................xvii
Introduction ..........................................................................................................xix
Chapter 1: Django Basics ........................................................................................1
Introduction ..........................................................................................................1
Fundamentals of HTTP ............................................................................................2
HTTP Methods .......................................................................................................4
POST Method ...................................................................................................4
GET Method .....................................................................................................4
PUT Method .....................................................................................................5
DELETE Method ...............................................................................................5
CGI ......................................................................................................................6
WSGI ...................................................................................................................7
wsgiref Package ...................................................................................................8
What Is a Web Framework? ................................................................................11
MVC vs. MVT .......................................................................................................14
Asynchronous Processing ...................................................................................16
asyncio Module .............................................................................................16
ASGI ....................................................................................................................19
Overview of Django .............................................................................................21
Batteries Included .........................................................................................21
Utility Apps .....................................................................................................21
Scalability ......................................................................................................22
Documentation and Support ..........................................................................22
Summary ............................................................................................................22
Chapter 2: Django: First Steps ...............................................................................23
Install Django ......................................................................................................24
Installation on Ubuntu ...................................................................................24
Installation on Windows ................................................................................28
Set Up the Django Project ...................................................................................29
Django App ..........................................................................................................33
Add an App ....................................................................................................35
Define Views ..................................................................................................35
Define urlpatterns ..........................................................................................36
Update URLCONF ...........................................................................................37
Path Parameters ............................................................................................38
Serving Web Pages ........................................................................................40
Admin Site ...........................................................................................................43
Summary ............................................................................................................49
Chapter 3: Django ORM .........................................................................................51
DB-API .................................................................................................................52
What Is ORM? ......................................................................................................57
Define a Model ....................................................................................................60
Database Configuration .......................................................................................61
Run Migrations ....................................................................................................62
Register Model with Admin Site ..........................................................................64
Django Admin Shell .............................................................................................65
Add Objects ...................................................................................................66
Retrieval ........................................................................................................67
Search ...........................................................................................................69
Updating the Objects .....................................................................................70
Model Field Types ...............................................................................................72
CharField .......................................................................................................73
IntegerField ...................................................................................................73
FloatField .......................................................................................................74
BooleanField ..................................................................................................74
DateField .......................................................................................................74
Types of Relationships ........................................................................................75
One-to-One Relationship ...............................................................................77
One-to-Many Relationship .............................................................................79
Many-to-Many Relationship ..........................................................................80
Summary ............................................................................................................82
Chapter 4: Django Templates ................................................................................85
Template Object ..................................................................................................86
render( ) Function ................................................................................................90
Template Context ................................................................................................90
Template Tags .....................................................................................................92
{% if %} Tag ...................................................................................................93
{% for %} Tag .................................................................................................96
Form Templates ................................................................................................100
HTML Form ..................................................................................................100
Form Class ...................................................................................................103
ModelForm ..................................................................................................108
Class-Based View .............................................................................................111
Generic Views ...................................................................................................114
TemplateView ..............................................................................................114
CreateView ..................................................................................................116
UpdateView .................................................................................................118
DeleteView ...................................................................................................119
DetailView ....................................................................................................121
ListView .......................................................................................................122
Static Files ........................................................................................................125
Image As Static Asset ..................................................................................129
CSS and JavaScript .....................................................................................131
Template Inheritance ........................................................................................134
{% include %} Tag ........................................................................................135
{% block %} Tag ...........................................................................................139
{% extends %} Tag .......................................................................................140
Summary ..........................................................................................................143
Chapter 5: Django: Using Databases ...................................................................145
SQLAlchemy ORM .............................................................................................146
Engine ..........................................................................................................148
Table in SQLAlchemy Core ...........................................................................149
Model ...........................................................................................................151
Session ........................................................................................................153
Alembic .............................................................................................................156
Advent of NOSQL Databases .............................................................................161
MongoDB ..........................................................................................................162
Installation ........................................................................................................162
Local Deployment ........................................................................................162
Atlas ............................................................................................................163
MongoDB Shell ............................................................................................164
Compass ......................................................................................................166
PyMongo ...........................................................................................................171
Insert Document ..........................................................................................172
Retrieval ......................................................................................................173
MongoEngine ....................................................................................................176
Document Class ...........................................................................................177
Connection ...................................................................................................178
DynamicDocument ......................................................................................181
Djongo ...............................................................................................................183
Summary ..........................................................................................................186
Chapter 6: Advanced Django .............................................................................187
Messages Framework .......................................................................................187
Cookies ........................................................................................................188
Sessions ......................................................................................................189
Activating Messaging ..................................................................................190
Storage Backends .......................................................................................192
Adding Messages ........................................................................................193
Fetching Messages ......................................................................................194
Authentication ...................................................................................................197
Login and Logout .........................................................................................198
New User .....................................................................................................202
@login_required( ) .......................................................................................204
Security Features ..............................................................................................207
CSRF ............................................................................................................207
XSS ..............................................................................................................209
SQL Injection ...............................................................................................211
async Views ......................................................................................................213
Adapter Functions .......................................................................................217
async Querysets ..........................................................................................218
Reusable Apps ..................................................................................................218
Django Debug Toolbar .......................................................................................223
Summary ..........................................................................................................228
Chapter 7: REST API with Django ..........................................................................229
What Is API? ......................................................................................................230
REST Architecture .............................................................................................233
Uniform Interface .........................................................................................233
Statelessness ..............................................................................................234
Client-Server ...............................................................................................234
Cacheability .................................................................................................234
Layered System ...........................................................................................235
Code on Demand .........................................................................................235
Serialization ...................................................................................................235
Django REST Framework ..................................................................................238
DRF – Get Started ........................................................................................238
Serializer Class ............................................................................................244
ModelSerializer ............................................................................................249
DRF – Class-Based Views ............................................................................264
DRF – Generic Views ...................................................................................267
ViewSets ......................................................................................................271
Routers ........................................................................................................273
DRF – Authentication .....................................................................................276
Alternatives to DRF ...........................................................................................288
Django Ninja ......................................................................................................289
Summary ..........................................................................................................298
Chapter 8: GraphQL with Django .........................................................................299
GraphQL vs. REST .............................................................................................300
GraphQL Architecture ........................................................................................301
Schema Definition Language ............................................................................302
Types ...........................................................................................................302
Queries ........................................................................................................304
Mutations .....................................................................................................305
Subscriptions ...............................................................................................306
Schema .......................................................................................................307
GraphQL and Python .........................................................................................308
Strawberry ........................................................................................................309
Strawberry-Django ............................................................................................316
Graphene ...........................................................................................................322
Graphene-Django ..............................................................................................330
Summary ..........................................................................................................334
Chapter 9: WebSockets with Django ...................................................................335
WebSocket Protocol ..........................................................................................336
WebSocket and Python .....................................................................................338
Django Channels ...............................................................................................344
Consumers ........................................................................................................348
Routing ..............................................................................................................349
Channel Layers .................................................................................................354
Single Channel ..............................................................................................356
Groups .........................................................................................................356
WebSocket Client Template ...............................................................................358
Login/Logout .....................................................................................................360
Summary ..........................................................................................................362
Chapter 10: ReactJS with Django ..........................................................................363
ReactJS .............................................................................................................364
React App ..........................................................................................................366
React Developer Tools .......................................................................................370
What Is Promise? ..............................................................................................370
useState Hook ...................................................................................................372
useEffect Hook ..................................................................................................373
Axios .................................................................................................................374
DRF Backend ...............................................................................................381
Axios Frontend .............................................................................................385
Apollo ................................................................................................................394
Graphene-Django Backend ..........................................................................398
Apollo Frontend ...........................................................................................400
BookList Component ...................................................................................401
React for WebSocket .........................................................................................404
Summary ..........................................................................................................410
Index ................................................................................................................411
Download
Rutracker.org не распространяет и не хранит электронные версии произведений, а лишь предоставляет доступ к создаваемому пользователями каталогу ссылок на торрент-файлы, которые содержат только списки хеш-сумм
Как скачивать? (для скачивания .torrent файлов необходима регистрация)
[Профиль]  [ЛС] 
 
Ответить
Loading...
Error