توضیحاتی در مورد کتاب :
بیاموزید چگونه با مقابله با فعالیتهای عملی بر اساس مطالعات موردی واقع بینانه، وبسایتهای خود را به سادگی، ایمن و سریع با جنگو ایجاد کنید
ویژگیهای کلیدی
- درک عملکرد جنگو و الگوی Model-View-Template (MVT)
- ایجاد و به طور مکرر یک وب سایت بررسی کتاب بسازید و در حین ایجاد دانش خود ویژگی هایی را اضافه کنید
- مفاهیم پیشرفته را کاوش کنید مانند پیادهسازی REST API و ادغام ماژول شخص ثالث
توضیحات کتاب
آیا میخواهید به جای هزینه کردن، برنامههای قابل اعتماد و ایمن ایجاد کنید که از همه متمایز باشند. ساعت در دیگ بخار کد؟ سپس چارچوب جنگو جایی است که باید شروع کنید. جنگو که اغلب به عنوان یک چارچوب توسعه وب «شامل باتریها» شناخته میشود، با تمام ویژگیهای اصلی مورد نیاز برای ساخت یک برنامه کاربردی مستقل ارائه میشود.
توسعه وب با جنگو از این فلسفه استفاده میکند و شما را به دانش و اعتماد به نفس مجهز میکند. با استفاده از Python برنامههای کاربردی دنیای واقعی بسازید.
با شروع مفاهیم اساسی جنگو، ویژگیهای اصلی آن را با ساختن وبسایتی به نام Bookr – مخزنی برای بررسی کتابها، پوشش خواهید داد. این مطالعه موردی پایان به انتها به مجموعهای از پروژههای کوچک تقسیم میشود که بهعنوان تمرینها و فعالیتها ارائه میشوند و به شما این امکان را میدهند تا خود را به شیوهای لذتبخش و قابل دستیابی به چالش بکشید.
همانطور که پیشرفت میکنید، خواهید توانست مهارتهای عملی مختلفی را بیاموزید، از جمله نحوه ارائه فایلهای استاتیک برای افزودن CSS، جاوا اسکریپت و تصاویر به برنامهتان، نحوه پیادهسازی فرمها برای پذیرش ورودی کاربر، و نحوه مدیریت جلسات برای اطمینان از تجربه کاربری قابل اعتماد. در سراسر این کتاب، شما وظایف روزانه کلیدی را که بخشی از چرخه توسعه یک برنامه وب در دنیای واقعی هستند، پوشش خواهید داد.
در پایان این کتاب، مهارت ها و اعتماد به نفس خلاقانه را خواهید داشت. با Django به پروژه های بلندپروازانه خود بپردازید.
آنچه یاد خواهید گرفت
- یک برنامه کاربردی جدید ایجاد کنید و مدل هایی را برای توصیف داده های خود اضافه کنید
- از نماها و الگوهایی برای کنترل رفتار و ظاهر
- اجرای کنترل دسترسی از طریق احراز هویت و مجوزها
- ایجاد فرم های وب عملی برای افزودن ویژگی هایی مانند آپلود فایل
- ایجاد یک API RESTful و کد جاوا اسکریپت که با آن ارتباط برقرار می کند
- به پایگاه داده ای مانند PostgreSQL متصل شوید
این کتاب برای چه کسانی است
توسعه وب با جنگو برای برنامه نویسانی که می خواهند مهارت های توسعه وب را با چارچوب جنگو به دست آورند. برای درک کامل مفاهیم توضیح داده شده در این کتاب، باید دانش اولیه برنامه نویسی پایتون و همچنین آشنایی با جاوا اسکریپت، HTML و CSS داشته باشید.
فهرست محتوا
- مقدمه ای بر جنگو
- مدل ها و مهاجرت ها
- نقشه، نماها و قالب های آدرس اینترنتی
- مقدمه ای بر مدیریت جنگو
- سرویس فایل های استاتیک< /li>
- Forms
- تأیید اعتبار فرم پیشرفته و فرمهای مدل
- سرویس رسانه و آپلود فایل
- جلسات و احراز هویت
- پیشرفته ادمین جنگو و سفارشیسازیها
- قالبهای پیشرفته و نمایشهای مبتنی بر کلاس
- ساخت API REST
- تولید CSV، PDF و سایر فایلهای باینری
- آزمایش
- کتابخانه های شخص ثالث جنگو
- استفاده از کتابخانه جاوا اسکریپت Frontend با جنگو
فهرست مطالب :
Cover
FM
Copyright
Table of Contents
Preface
Chapter 1: Introduction to Django
Introduction
Scaffolding a Django Project and App
Exercise 1.01: Creating a Project and App, and Starting the Dev Server
Model View Template
Models
Views
Templates
MVT in Practice
Introduction to HTTP
Processing a Request
Django Project
The myproject Directory
Django Development Server
Django Apps
PyCharm Setup
Exercise 1.02: Project Setup in PyCharm
View Details
URL Mapping Detail
Exercise 1.03: Writing a View and Mapping a URL to It
GET, POST, and QueryDict Objects
Exercise 1.04: Exploring GET Values and QueryDict
Exploring Django Settings
Using Settings in Your Code
Finding HTML Templates in App Directories
Exercise 1.05: Creating a Templates Directory and a Base Template
Rendering a Template with the render Function
Exercise 1.06: Rendering a Template in a View
Rendering Variables in Templates
Exercise 1.07: Using Variables in Templates
Debugging and Dealing with Errors
Exceptions
Exercise 1.08: Generating and Viewing Exceptions
Debugging
Exercise 1.09: Debugging Your Code
Activity 1.01: Creating a Site Welcome Screen
Activity 1.02: Book Search Scaffold
Summary
Chapter 2: Models and Migrations
Introduction
Databases
Relational Databases
Non-Relational Databases
Database Operations Using SQL
Data Types in Relational databases
Exercise 2.01: Creating a Book Database
SQL CRUD Operations
SQL Create Operations
SQL Read Operations
SQL Update Operations
SQL Delete Operations
Django ORM
Database Configuration and Creating Django Applications
Django Apps
Django Migration
Creating Django Models and Migrations
Field Types
Field Options
Primary Keys
Relationships
Many to One
Many to Many
One-to-One Relationships
Adding the Review Model
Model Methods
Migrating the Reviews App
Django’s Database CRUD Operations
Exercise 2.02: Creating an Entry in the Bookr Database
Exercise 2.03: Using the create() Method to Create an Entry
Creating an Object with a Foreign Key
Exercise 2.04: Creating Records for a Many-to-One Relationship
Exercise 2.05: Creating Records with Many-to-Many Relationships
Exercise 2.06: A Many-to-Many Relationship Using the add() Method
Using create() and set() Methods for Many-to-Many Relationships
Read Operations
Exercise 2.07: Using the get() Method to Retrieve an Object
Returning an Object Using the get() Method
Exercise 2.08: Using the all() Method to Retrieve a Set of Objects
Retrieving Objects by Filtering
Exercise 2.09: Using the filter() Method to Retrieve Objects
Filtering by Field Lookups
Using Pattern Matching for Filtering Operations
Retrieving Objects by Excluding
Retrieving Objects Using the order_by() Method
Querying Across Relationships
Querying Using Foreign Keys
Querying Using Model Name
Querying Across Foreign Key Relationships Using the Object Instance
Exercise 2.10: Querying Across a Many-to-Many Relationship Using Field Lookup
Exercise 2.11: A Many-to-Many Query Using Objects
Exercise 2.12: A Many-to-Many Query Using the set() Method
Exercise 2.13: Using the update() Method
Exercise 2.14: Using the delete() Method
Activity 2.01: Create Models for a Project Management Application
Populating the Bookr Project’s Database
Summary
Chapter 3: URL Mapping, Views, and Templates
Introduction
Function-Based Views
Class-Based Views
URL Configuration
Exercise 3.01: Implementing a Simple Function-Based View
Templates
Exercise 3.02: Using Templates to Display a Greeting Message
Django Template Language
Template Variables
Template Tags
Comments
Filters
Exercise 3.03: Displaying a List of Books and Reviews
Template Inheritance
Template Styling with Bootstrap
Exercise 3.04: Adding Template Inheritance and a Bootstrap Navigation Bar
Activity 3.01: Implement the Book Details View
Summary
Chapter 4: Introduction to Django Admin
Introduction
Creating a Superuser Account
Exercise 4.01: Creating a Superuser Account
CRUD Operations Using the Django Admin App
Create
Retrieve
Update
Delete
Users and Groups
Exercise 4.02: Adding and Modifying Users and Groups through the Admin app
Registering the Reviews Model
Change Lists
The Publisher Change Page
The Book Change Page
Exercise 4.03: Foreign Keys and Deletion Behavior in the Admin App
Customizing the Admin Interface
Site-Wide Django Admin Customizations
Examining the AdminSite object from the Python Shell
Subclassing AdminSite
Activity 4.01: Customizing the SiteAdmin
Customizing the ModelAdmin Classes
The List Display Fields
The Filter
Exercise 4.04: Adding a Date list_filter and date_hierarchy
The Search Bar
Excluding and Grouping Fields
Activity 4.02: Customizing the Model Admins
Summary
Chapter 5: Serving Static Files
Introduction
Static File Serving
Introduction to Static File Finders
Static File Finders: Use During a Request
AppDirectoriesFinder
Static File Namespacing
Exercise 5.01: Serving a File from an App Directory
Generating Static URLs with the static Template Tag
Exercise 5.02: Using the static Template Tag
FileSystemFinder
Exercise 5.03: Serving from a Project static Directory
Static File Finders: Use During collectstatic
Exercise 5.04: Collecting Static Files for Production
STATICFILES_DIRS Prefixed Mode
The findstatic Command
Exercise 5.05: Finding Files Using findstatic
Serving the Latest Files (for Cache Invalidation)
Exercise 5.06: Exploring the ManifestFilesStorage Storage Engine
Custom Storage Engines
Activity 5.01: Adding a reviews Logo
Activity 5.02: CSS Enhancements
Activity 5.03: Adding a Global Logo
Summary
Chapter 6: Forms
Introduction
What Is a Form?
The
توضیحاتی در مورد کتاب به زبان اصلی :
Learn how to create your own websites simply, safely, and quickly with Django by tackling practical activities based on realistic case studies
Key Features
- Understand Django functionality and the Model-View-Template (MVT) paradigm
- Create and iteratively build a book review website, adding features as you build your knowledge
- Explore advanced concepts such as REST API implementation and third-party module integration
Book Description
Do you want to develop reliable and secure applications which stand out from the crowd, rather than spending hours on boilerplate code? Then the Django framework is where you should begin. Often referred to as a 'batteries included' web development framework, Django comes with all the core features needed to build a standalone application.
Web Development with Django takes this philosophy and equips you with the knowledge and confidence to build real-world applications using Python.
Starting with the essential concepts of Django, you'll cover its major features by building a website called Bookr – a repository for book reviews. This end-to-end case study is split into a series of bitesize projects that are presented as exercises and activities, allowing you to challenge yourself in an enjoyable and attainable way.
As you progress, you'll learn various practical skills, including how to serve static files to add CSS, JavaScript, and images to your application, how to implement forms to accept user input, and how to manage sessions to ensure a reliable user experience. Throughout this book, you'll cover key daily tasks that are part of the development cycle of a real-world web application.
By the end of this book, you'll have the skills and confidence to creatively tackle your own ambitious projects with Django.
What you will learn
- Create a new application and add models to describe your data
- Use views and templates to control behavior and appearance
- Implement access control through authentication and permissions
- Develop practical web forms to add features such as file uploads
- Develop a RESTful API and JavaScript code that communicates with it
- Connect to a database such as PostgreSQL
Who this book is for
Web Development with Django is designed for programmers who want to gain web development skills with the Django framework. To fully understand the concepts explained in this book, you must have basic knowledge of Python programming, as well as familiarity with JavaScript, HTML, and CSS.
Table of Contents
- Introduction to Django
- Models and Migrations
- URL Mapping, Views, and Templates
- Introduction to Django Admin
- Serving Static Files
- Forms
- Advanced Form Validation and Model Forms
- Media Serving and File Uploads
- Sessions and Authentication
- Advanced Django Admin and Customizations
- Advanced Templating and Class Based Views
- Building a REST API
- Generating CSV, PDF, and Other Binary Files
- Testing
- Django Third-Party Libraries
- Using a Frontend JavaScript Library with Django