Oath of Fealty
معرفی کتاب «Oath of Fealty» نوشتهٔ Leonardo Luis Lazzaro و Niven, Larry; Pournelle, Jerry، منتشرشده توسط نشر 2011 در سال 2011. این کتاب در فرمت epub، زبان انگلیسی ارائه شده است.
Craft Scalable and Dynamic Web Apps using Django and Python. This comprehensive guide is an indispensable resource for developers seeking to elevate their web development skills in Django and Python. The book begins by establishing a strong foundation and understanding of Django's architecture, emphasizing the Model-View-Template (MVT) pattern and a pivotal service layer for creating scalable web applications. The book then progresses to practical aspects, guiding readers through the development of a Task Management App. This hands-on approach reinforces fundamental concepts and showcases Django's flexibility and efficiency in real-world scenarios. The advanced sections of the book will help you tackle complex challenges, covering topics like preventing double-form submissions, implementing offline pessimistic and optimistic locking techniques, mastering API development with Django Ninja, and ensuring application reliability through exhaustive testing with pytest. The book culminates in practical insights for deploying Django applications with Docker and Kubernetes, this guide equips you to tackle real-world challenges effectively. Who this book is for: Beginners will find comprehensive coverage of foundational topics, while more experienced programmers will delve into advanced subjects, such as preventing double-form submissions and implementing offline pessimistic and optimistic locking techniques. This book guides readers through building a comprehensive web application using Django and Python. Each chapter builds upon the last, from setting up a development environment to deploying a fully functional application running in a Kubernetes cluster. Chapter 1: Introduction to Django and Python This chapter introduces Python and the Django framework, detailing Django's philosophy, the latest features in Django 4.2, and the compatibility of Python's syntax and semantics with Django. Chapter 2: Setting Up Your Development Environment This chapter guides you through establishing a reliable development environment, including Python installation, version management with pyenv, and creating isolated environments with poetry, equipping you for efficient Django development. Chapter 3: Getting Started with Django Projects and Apps This chapter introduces you to the initial steps of starting Django projects and apps. You'll learn about the Django project structure, the role of each component, Django's MVT architecture, configuring Django projects, and a brief introduction to Django's development server. ... Chapter 10: Testing with pytest This chapter introduces pytest, guiding you through writing practical tests for Django apps. It covers testing views and forms, ensuring code reliability and maintainability. Chapter 11: Deploying Django Applications with Gunicorn and Docker This chapter discusses deploying Django applications using Gunicorn and Docker. It includes insights into creating Dockerfiles, configuring Kubernetes clusters, and adding liveness and readiness probes for application scaling. Chapter 12: Final Thoughts and Future Directions This concluding chapter reflects on building a Django task management app and looks ahead at Django's future. It discusses the Django ecosystem, additional tools, and staying updated with the community. Cover Page Title Page Copyright Page About the Author About the Technical Reviewer Acknowledgements Preface Errata Table of Contents 1. Introduction to Django and Python Introduction Structure Introduction to Python Understanding variables as references Parameter passing Interfaces or protocols Standard modules Error handling List comprehensions F-Strings Type hinting Coding style Introduction to Django The Django Philosophy Don’t repeat yourself Loose coupling and High cohesion Less code and quick development Explicit is better than implicit Models: Include all relevant domain logic Separate logic from the presentation on templates Views Caching Django 4.2 highlights Support for psycopg3 Comments on columns and tables In-memory file storage Custom file storages Updates in password validation Minor updates and additions Python for Django Conclusion Questions 2. Setting Up Your Development Environment Introduction Structure Introduction to Development Environments Managing Python Versions with Pyenv Understanding Virtual Environments Introduction to Poetry for Dependency Management Setting up a Django Project with Poetry Basic Configuration for a Django Project Introduction to Git for Version Control Creating a GitHub repository Branching models Git Flow GitHub Flow Trunk-based Advanced Git Usage: Using Worktree Conclusion Questions 3. Getting Started with Django Projects and Apps Introduction Structure Introduction to the task manager Django project versus Django application Creating a new Django project Understanding the Django project structure Starting your first Django app Understanding the Django app structure MVT design patterns in Django Extending the MVT pattern with a service layer Configuring your Django app Brief introduction to Django’s development server Running your first Django app Conclusion Questions Exercises 4. Django Models and PostgreSQL Introduction Structure Understanding Django models Creating your first model Django’s database API: Create, retrieve, update, and delete operations Understanding Django migrations Django’s admin interface: Registering models and manipulating data Introduction to Django’s ORM: Queries and aggregations Extending the models Ensuring data integrity with model constraints Conclusion Questions Exercises 5. Django Views and URL Handling Introduction Structure Understanding Django Views Introducing Django’s Generic Views Writing Your First Django View Class-based Views Mixins URL Configuration in Django Creating URL Patterns for your Views Handling Dynamic URLs with Path Converters Understanding Django’s URL Namespace and Naming URL Patterns Using Django’s HttpRequest And HttpResponse Objects Introducing to Function-based Views Using Function-based Views with a Service Layer Pessimistic and Optimistic Offline Locking using Views and a Service Layer Error Handling with Custom Error Views Conclusion Questions Exercises 6. Using the Django Template Engine Introduction Structure Introduction to Django Template Engine Django Template Language: Variables, Tags, and Filters Inheritance in Django Templates The Home Page View: Showing Tasks by Status Custom Template Tags and Filters Using Static Files in Django Templates: CSS, JavaScript, Images Django Template Context Processors Debugging Django Templates Optimizing Template Rendering Securing Django Templates Conclusion Questions Exercises 7. Forms in Django Introduction Structure Understanding Django Forms Creating Your First Django Form Rendering Forms in Templates Handling Form Submission in Views Working with Form Fields Custom form fields File and Image Upload Field Data Validation with Django Forms Validators Clean methods ModelForm Validation Displaying Form Errors Advanced Form Handling: ModelFormsSets and Formsets Preventing Double Submission in Forms Conclusion Questions Exercises 8. User Authentication and Authorization in Django Introduction Structure Understanding Django’s Authentication System Introduction to Django’s Middleware Understanding Django Middleware User Registration with Django’s User Model Authenticating Users: Login and Logout Managing User Sessions Session customization Session usage Session good practices Password Management in Django: Change and Password Reset Protecting Views with Login Required Decorators User Authorization: Permissions and Groups Multi-tenant authentication with Custom Django’s User Model Security Best Practices in Django Update all your libraries and frameworks Project Settings Hardening Turn off Debug in production Use Secure Cookies HTTP Strict Transport Security (HSTS) Content Security Policy (CSP) X-Content-Type-Options X-XSS-Protection Secure Referrer Policy Use Secure Password Hashing Algorithms Limit Access to Admin Keep SECRET_KEY Secret Set ALLOWED_HOSTS Conclusion Questions Exercises 9. Django Ninja and APIs Introduction Structure Introduction to API design API Design-first approach HTTP Response status codes Introduction to Django Ninja Setting Up Django Ninja in Your Project Building Your first API with Django Ninja Request and Response Models with Pydantic API Documentation Understanding HTTP Methods in Django Ninja API Pagination Working with Path Parameters and Query Parameters Validation and Error Handling in Django Ninja Authenticating API Users Securing APIs: Permissions and Throttling Permissions Throttling Versioning Your API Conclusion Questions Exercises 10. Testing with pytest Introduction Structure Introduction to testing and pytest Understanding test Test-driven development Introduction to pytest Installing and setting up pytest for Django Understanding Django test database and pytest Pytest-django fixtures Mocking and patching in tests Behavior-driven development Advanced pytest features: Parametrization, plugins, and configuration Parametrization Plugin coverage Plugin xdist Using marks Configuration tips Conclusion Questions Exercises 11. Deploying Django Applications with Gunicorn and Docker Introduction Structure Introduction to Gunicorn Configuring Gunicorn for Django Deployment Understanding and Creating Dockerfiles for Django Using the image registry Introduction to Kubernetes Cluster Node Scheduler Pods Deployments ReplicaSets Services Configmaps and Secrets Ingress StatefulSets Configuring a Kubernetes cluster for a Django application Adding liveness and readiness probes Adding Instrumentation for Django Prometheus configuration Jaeger configuration Database Optimization: Queries and Indexing Conclusion Questions 12. Final Thoughts and Future Directions Introduction Structure Summary of learnings: Building a task management app Evaluating the Django ecosystem: Strengths and weaknesses Exploring additional Django tools and libraries Potential enhancements for the task management app Staying updated with Django: Resources and communities Career opportunities with Django skills Thoughts on Django’s future: Upcoming features and trends Tips for continued learning and improvement Conclusion Index Craft Scalable and Dynamic Web Apps using Django and Python Key Features Real-World Practices and Solutions for Crafting Dynamic and Scalable Django Solutions. Build a Comprehensive Task Management System Hands-On. Explore Advanced API, Testing, and Deployment Techniques with Real-World Applications. Book Description This comprehensive guide is an indispensable resource for developers seeking to elevate their web development skills in Django and Python. The book begins by establishing a strong foundation and understanding of Django's architecture, emphasizing the Model-View-Template (MVT) pattern and a pivotal service layer for creating scalable web applications. The book then progresses to practical aspects, guiding readers through the development of a Task Management App. This hands-on approach reinforces fundamental concepts and showcases Django's flexibility and efficiency in real-world scenarios. The advanced sections of the book will help you tackle complex challenges, covering topics like preventing double-form submissions, implementing offline pessimistic and optimistic locking techniques, mastering API development with Django Ninja, and ensuring application reliability through exhaustive testing with pytest. The book culminates in practical insights for deploying Django applications with Docker and Kubernetes, this guide equips you to tackle real-world challenges effectively. What you will learn Unlock the potential of Django 4.2 and Python for robust web development expertise. Seamlessly build and deploy a complete Django project, implementing essential features like authentication, authorization, and multi-tenant capabilities. Develop and secure APIs with Django Ninja, following best practices for a streamlined process. Gain mastery in testing with pytest, ensuring the creation of reliable, bug-free Django applications. Elevate your skills and create web solutions with confidence using the latest tools and techniques in Django development. Who is this book for? This book caters to web development enthusiasts, Python developers and experienced programmers looking to build scalable web apps with Django. Whether you're new to programming or seeking advanced insights, this guide offers a progressive approach. Beginners establish a strong foundation, while seasoned developers delve into advanced topics like preventing double-form submissions and implementing locking techniques. Table of Contents 1. Introduction to Django and Python2. Setting Up Your Development Environment3. Getting Started with Django Projects and Apps4. Django Models and PostgreSQL5. Django Views and URL Handling6. Using the Django Template Engine7. Forms in Django8. User Authentication and Authorization in Django9. Django Ninja and APIs10. Testing with pytest11. Deploying Django Applications with Gunicorn and Docker12. Final Thoughts and Future Directions Index About the Author Born in Buenos Aires (la Ciudad de la Furia), Argentina, Leonardo Luis Lazzaro has always been fascinated by the idea of creating something out of nothing. His first contact with computers began at an early age, fueled by classic video games like Maniac Mansion and Monkey Island.
دانلود کتاب Oath of Fealty