Ultimate Django for Web App Development Using Python: Build Modern, Reliable and Scalable Production-Grade Web Applications with Django and Python

Оглавление⌄
Cover PageTitle PageCopyright PageAbout the AuthorAbout the Technical ReviewerAcknowledgementsPrefaceErrataTable of Contents1. Introduction to Django and PythonIntroductionStructureIntroduction to PythonUnderstanding variables as referencesParameter passingInterfaces or protocolsStandard modulesError handlingList comprehensionsF-StringsType hintingCoding styleIntroduction to DjangoThe Django PhilosophyDon’t repeat yourselfLoose coupling and High cohesionLess code and quick developmentExplicit is better than implicitModels: Include all relevant domain logicSeparate logic from the presentation on templatesViewsCachingDjango 4.2 highlightsSupport for psycopg3Comments on columns and tablesIn-memory file storageCustom file storagesUpdates in password validationMinor updates and additionsPython for DjangoConclusionQuestions2. Setting Up Your Development EnvironmentIntroductionStructureIntroduction to Development EnvironmentsManaging Python Versions with PyenvUnderstanding Virtual EnvironmentsIntroduction to Poetry for Dependency ManagementSetting up a Django Project with PoetryBasic Configuration for a Django ProjectIntroduction to Git for Version ControlCreating a GitHub repositoryBranching modelsGit FlowGitHub FlowTrunk-basedAdvanced Git Usage: Using WorktreeConclusionQuestions3. Getting Started with Django Projects and AppsIntroductionStructureIntroduction to the task managerDjango project versus Django applicationCreating a new Django projectUnderstanding the Django project structureStarting your first Django appUnderstanding the Django app structureMVT design patterns in DjangoExtending the MVT pattern with a service layerConfiguring your Django appBrief introduction to Django’s development serverRunning your first Django appConclusionQuestionsExercises4. Django Models and PostgreSQLIntroductionStructureUnderstanding Django modelsCreating your first modelDjango’s database API: Create, retrieve, update, and delete operationsUnderstanding Django migrationsDjango’s admin interface: Registering models and manipulating dataIntroduction to Django’s ORM: Queries and aggregationsExtending the modelsEnsuring data integrity with model constraintsConclusionQuestionsExercises5. Django Views and URL HandlingIntroductionStructureUnderstanding Django ViewsIntroducing Django’s Generic ViewsWriting Your First Django ViewClass-based Views MixinsURL Configuration in DjangoCreating URL Patterns for your ViewsHandling Dynamic URLs with Path ConvertersUnderstanding Django’s URL Namespace and Naming URL PatternsUsing Django’s HttpRequest And HttpResponse ObjectsIntroducing to Function-based ViewsUsing Function-based Views with a Service LayerPessimistic and Optimistic Offline Locking using Views and a Service LayerError Handling with Custom Error ViewsConclusionQuestionsExercises6. Using the Django Template EngineIntroductionStructureIntroduction to Django Template EngineDjango Template Language: Variables, Tags, and FiltersInheritance in Django TemplatesThe Home Page View: Showing Tasks by StatusCustom Template Tags and FiltersUsing Static Files in Django Templates: CSS, JavaScript, ImagesDjango Template Context ProcessorsDebugging Django TemplatesOptimizing Template RenderingSecuring Django TemplatesConclusionQuestionsExercises7. Forms in DjangoIntroductionStructureUnderstanding Django FormsCreating Your First Django FormRendering Forms in TemplatesHandling Form Submission in ViewsWorking with Form FieldsCustom form fieldsFile and Image Upload FieldData Validation with Django FormsValidatorsClean methodsModelForm ValidationDisplaying Form ErrorsAdvanced Form Handling: ModelFormsSets and FormsetsPreventing Double Submission in FormsConclusionQuestionsExercises8. User Authentication and Authorization in DjangoIntroductionStructureUnderstanding Django’s Authentication SystemIntroduction to Django’s MiddlewareUnderstanding Django MiddlewareUser Registration with Django’s User ModelAuthenticating Users: Login and LogoutManaging User SessionsSession customizationSession usageSession good practicesPassword Management in Django: Change and Password ResetProtecting Views with Login Required DecoratorsUser Authorization: Permissions and GroupsMulti-tenant authentication with Custom Django’s User ModelSecurity Best Practices in DjangoUpdate all your libraries and frameworksProject Settings HardeningTurn off Debug in productionUse Secure CookiesHTTP Strict Transport Security (HSTS)Content Security Policy (CSP)X-Content-Type-OptionsX-XSS-ProtectionSecure Referrer PolicyUse Secure Password Hashing AlgorithmsLimit Access to AdminKeep SECRET_KEY SecretSet ALLOWED_HOSTSConclusionQuestionsExercises9. Django Ninja and APIsIntroductionStructureIntroduction to API designAPI Design-first approachHTTP Response status codesIntroduction to Django NinjaSetting Up Django Ninja in Your ProjectBuilding Your first API with Django NinjaRequest and Response Models with PydanticAPI DocumentationUnderstanding HTTP Methods in Django NinjaAPI PaginationWorking with Path Parameters and Query ParametersValidation and Error Handling in Django NinjaAuthenticating API UsersSecuring APIs: Permissions and ThrottlingPermissionsThrottlingVersioning Your APIConclusionQuestionsExercises10. Testing with pytestIntroductionStructureIntroduction to testing and pytestUnderstanding testTest-driven developmentIntroduction to pytestInstalling and setting up pytest for DjangoUnderstanding Django test database and pytestPytest-django fixturesMocking and patching in testsBehavior-driven developmentAdvanced pytest features: Parametrization, plugins, and configurationParametrizationPlugin coveragePlugin xdistUsing marksConfiguration tipsConclusionQuestionsExercises11. Deploying Django Applications with Gunicorn and DockerIntroductionStructureIntroduction to GunicornConfiguring Gunicorn for Django DeploymentUnderstanding and Creating Dockerfiles for DjangoUsing the image registryIntroduction to KubernetesClusterNodeSchedulerPodsDeploymentsReplicaSetsServicesConfigmaps and SecretsIngressStatefulSetsConfiguring a Kubernetes cluster for a Django applicationAdding liveness and readiness probesAdding Instrumentation for DjangoPrometheus configurationJaeger configurationDatabase Optimization: Queries and IndexingConclusionQuestions12. Final Thoughts and Future DirectionsIntroductionStructureSummary of learnings: Building a task management appEvaluating the Django ecosystem: Strengths and weaknessesExploring additional Django tools and librariesPotential enhancements for the task management appStaying updated with Django: Resources and communitiesCareer opportunities with Django skillsThoughts on Django’s future: Upcoming features and trendsTips for continued learning and improvementConclusionIndex
Описание
Коротко и по делу о том, что важно знать про django.
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. This comprehensive guide is an indispensable resource for developers seeking to elevate their web development skills in Django and Python. 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.
Whether you're new to programming or seeking advanced insights, this guide offers a progressive approach. What you will learnUnlock 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. Beginners establish a strong foundation, while seasoned developers delve into advanced topics like preventing double-form submissions and implementing locking techniques.
Если материал оказался полезен — сохраните страницу.
Поделиться
Частые вопросы
Можно ли скачать «Ultimate Django for Web App Development Using Python: Build Modern, Reliable and Scalable Production-Grade Web Applications with Django and Python» бесплатно?
Да, «Ultimate Django for Web App Development Using Python: Build Modern, Reliable and Scalable Production-Grade Web Applications with Django and Python» доступна для бесплатного скачивания на нашем сайте в формате PDF. Ссылка на файл находится на этой странице.
В каком формате и какого размера файл?
Книга предоставляется в формате PDF, размер файла 2,1 МБ.
Кто автор и когда вышла книга?
автор — Lazzaro Leonardo Luis, издательство Orange Education Pvt Ltd, AVA™, год выпуска 2024, 396 страниц.
О чём книга «Ultimate Django for Web App Development Using Python: Build Modern, Reliable and Scalable Production-Grade Web Applications with Django and Python»?
This comprehensive guide is an indispensable resource for developers seeking to elevate their web development skills in Django and Python.