Django Design Patterns and Best Practices Industry-Standard Web Development Techniques and Solutions Using Python

Learning to build more maintainable websites with Django either takes a lot of experience or familiarity with various pragmatic design patterns. This book will accelerate your journey into the world of web development. This new edition is updated with additional chapters and diagrams to help you get...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: Ravindran, Arun
Format: E-Book
Sprache:Englisch
Veröffentlicht: Birmingham Packt Publishing, Limited 2018
Packt Publishing Limited
Ausgabe:2
Schlagworte:
ISBN:9781788831345, 1788831349
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Abstract Learning to build more maintainable websites with Django either takes a lot of experience or familiarity with various pragmatic design patterns. This book will accelerate your journey into the world of web development. This new edition is updated with additional chapters and diagrams to help you get to grips with the current best practices in.
AbstractList Learning to build more maintainable websites with Django either takes a lot of experience or familiarity with various pragmatic design patterns. This book will accelerate your journey into the world of web development. This new edition is updated with additional chapters and diagrams to help you get to grips with the current best practices in.
Author Ravindran, Arun
Author_xml – sequence: 1
  fullname: Ravindran, Arun
BookMark eNpVTztPwzAYNOIhaMnIng11CNix48dI0_KQKtEBsUaO_TlqCQ7YqSr-PZaKKnHLd5_udLqboDM_eEDohuA7nHCvhCRCSkmZEuQETY4PP0XZUSSUVRdJxFQJzBIuURbjNgVQjCVn4grNFlvtuyFfQNx0Pl_rcYTgY669zecQx3wdtBk3BuI1One6j5D93Sl6f1y-1c_F6vXppX5YFbrkBJPCOEegBCG5s1gJo6F1VrW2Itq0oJRpS4eVtVKYUigrKmaBO6qskU44pugUzQ7Be92nMha6sPtJpPnUwTT_lifv7cH7FYbvXerbQDsMHwb8GHTfLOd1xXDFFaW_7OpYGw
ContentType eBook
DEWEY 006.7
DOI 10.0000/9781788834971
DatabaseTitleList
DeliveryMethod fulltext_linktorsrc
Discipline Engineering
Computer Science
EISBN 1788834976
9781788834971
Edition 2
ExternalDocumentID 9781788834971
EBC5405693
GroupedDBID -VX
AABBV
AAFKH
AAKGN
AANYM
AAXUV
AAZEP
AAZGR
ABARN
ABIWA
ABMRC
ABRSK
ABWNX
ACBYE
ACLGV
ADBND
ADVEM
AECLD
AEHEP
AEIUR
AERYV
AFQEX
AHWGJ
AJFER
ALMA_UNASSIGNED_HOLDINGS
APVFW
ATDNW
AVGCG
AZZ
BBABE
CZZ
DUGUG
E2F
EBSCA
GEOUK
IHRAH
L7C
OHILO
OODEK
QD8
UE6
ID FETCH-LOGICAL-a26101-cff1e2e786fd097caebfd9bd51acbe99cb2f09dd87c279d754de6f39dc8f7f493
ISBN 9781788831345
1788831349
IngestDate Fri Nov 21 19:29:51 EST 2025
Wed Dec 10 10:47:06 EST 2025
IsPeerReviewed false
IsScholarly false
LCCallNum_Ident TK5105.8885.D54 .R385 2018
Language English
LinkModel OpenURL
MergedId FETCHMERGED-LOGICAL-a26101-cff1e2e786fd097caebfd9bd51acbe99cb2f09dd87c279d754de6f39dc8f7f493
OCLC 1039704444
PQID EBC5405693
PageCount 274
ParticipantIDs walterdegruyter_marc_9781788834971
proquest_ebookcentral_EBC5405693
PublicationCentury 2000
PublicationDate 2018
[2018]
PublicationDateYYYYMMDD 2018-01-01
PublicationDate_xml – year: 2018
  text: 2018
PublicationDecade 2010
PublicationPlace Birmingham
PublicationPlace_xml – name: Birmingham
– name: Birmingham, UK
PublicationYear 2018
Publisher Packt Publishing, Limited
Packt Publishing Limited
Publisher_xml – name: Packt Publishing, Limited
– name: Packt Publishing Limited
RestrictionsOnAccess restricted access
SSID ssj0003008647
Score 2.0401654
Snippet Learning to build more maintainable websites with Django either takes a lot of experience or familiarity with various pragmatic design patterns. This book will...
SourceID walterdegruyter
proquest
SourceType Publisher
SubjectTerms COM060080 COMPUTERS / Web / General
COMPUTERS / Programming / Open Source
COMPUTERS / Programming Languages / Python
Django (Electronic resource)
Web site development-Computer programs
Web sites-Authoring programs
Subtitle Industry-Standard Web Development Techniques and Solutions Using Python
TableOfContents Summary -- Chapter 4: Views and URLs -- A view from the top -- Views got classier -- Class-based generic views -- Class-Based Views are not always Class-Based Generic Views -- View mixins -- Order of mixins -- Decorators -- View patterns -- Pattern - access controlled views -- Problem details -- Solution details -- Pattern - context enhancers -- Problem details -- Solution details -- Pattern - services -- Problem details -- Solution details -- Designing URLs -- URL anatomy -- What happens in urls.py? -- Simplified URL pattern syntax -- Regular expression URL pattern syntax -- Can the simplified syntax replace regular expressions? -- Names and namespaces -- Pattern order -- URL pattern styles -- Department store URLs -- RESTful URLs -- React.js, Vue.js, and other view replacements -- Summary -- Chapter 5: Templates -- Understanding Django's template language features -- Variables -- Attributes -- Filters -- Tags -- Philosophy - don't invent a programming language -- Jinja2 -- Organizing templates -- How templates work -- Using Bootstrap -- But they all look the same! -- Lightweight alternatives -- Template patterns -- Pattern - template inheritance tree -- Problem details -- Solution details -- Pattern - the active link -- Problem details -- Solution details -- A template-only solution -- Custom tags -- Summary -- Chapter 6: Admin Interface -- Using the admin interface -- Enhancing models for the admin -- Not everyone should be an admin -- Admin interface customizations -- Changing the heading -- Changing the base and stylesheets -- Adding a rich-text editor for WYSIWYG editing -- Bootstrap-themed admin -- Complete overhauls -- Protecting the admin -- Pattern - feature flags -- Problem details -- Solution details -- Summary -- Chapter 7: Forms -- How forms work -- Forms in Django -- Why does data need cleaning? -- Displaying forms -- Time to be crisp
Understanding CSRF -- Form processing with class-based views -- Form patterns -- Pattern - dynamic form generation -- Problem details -- Solution details -- Pattern - user-based forms -- Problem details -- Solution details -- Pattern - multiple form actions per view -- Problem details -- Solution details -- Separate views for separate actions -- Same view for separate actions -- Pattern - CRUD views -- Problem details -- Solution details -- Summary -- Chapter 8: Working Asynchronously -- Why asynchronous? -- Pitfalls of asynchronous code -- Asynchronous patterns -- Endpoint callback pattern -- Publish-subscribe pattern -- Polling pattern -- Asynchronous solutions for Django -- Working with Celery -- How Celery works -- Celery best practices -- Handling failure -- Idempotent tasks -- Avoid writing to shared or global state -- Database updates without race conditions -- Avoid passing complex objects to tasks -- Understanding asyncio -- asyncio versus threads -- The classic web-scraper example -- Synchronous web-scraping -- Asynchronous web-scraping -- Concurrency is not parallelism -- Entering Channels -- Listening to notifications with WebSockets -- Differences from Celery -- Summary -- Chapter 9: Creating APIs -- RESTful API -- API design -- Versioning -- Django Rest framework -- Improving the Public Posts API -- Hiding the IDs -- API patterns -- Pattern - human browsable interface -- Problem details -- Solution details -- Pattern - Infinite Scrolling -- Problem details -- Solution details -- Summary -- Chapter 10: Dealing with Legacy Code -- Finding the Django Version -- Activating the virtual environment -- Where are the files? This is not PHP -- Starting with urls.py -- Jumping around the code -- Understanding the code base -- Creating the big picture -- PyGraphviz installation and usage -- Incremental change or a full rewrite?
f-strings or formatted string literals -- Exception syntax changes and improvements -- Standard library reorganized -- New goodies -- Pyvenv and pip are built in -- Other changes -- Further information -- Other Books You May Enjoy -- Index
Writing tests before making any changes -- Step-by-step process to writing tests -- Legacy database integration -- Future proofing -- Summary -- Chapter 11: Testing and Debugging -- Why write tests? -- TDD -- Writing a test case -- The assert method -- Writing better test cases -- Mocking -- Pattern - Test fixtures and factories -- Problem details -- Solution details -- Learning more about testing -- Debugging -- Django debug page -- A better debug page -- The print function -- Logging -- The Django Debug Toolbar -- The Python debugger pdb -- Other debuggers -- Debugging Django templates -- Summary -- Chapter 12: Security -- Cross-site scripting -- Why are your cookies valuable? -- How Django helps -- Where Django might not help -- Cross-site request forgery -- How Django helps -- Where Django might not help -- SQL injection -- How Django helps -- Where Django might not help -- Clickjacking -- How Django helps -- Shell injection -- How Django helps -- And the web attacks are unending -- A handy security checklist -- Summary -- Chapter 13: Production-Ready -- The production environment -- Choosing a web stack -- Components of a stack -- Virtual machines or Docker -- Microservices -- Hosting -- Platform as a service -- Virtual private servers -- Serverless -- Other hosting approaches -- Deployment tools -- Fabric -- Typical deployment steps -- Configuration management -- Monitoring -- Improving Performance -- Frontend performance -- Backend performance -- Templates -- Database -- Caching -- Cached session backend -- Caching frameworks -- Caching patterns -- Summary -- Appendix: Python 2 Versus Python 3 -- Python 3 -- Python 3 for Djangonauts -- Change all __unicode__ methods into __str__ -- All classes inherit from object -- Calling super() is easier -- Relative imports must be explicit -- HttpRequest and HttpResponse have str and bytes types
Cover -- Title Page -- Copyright and Credits -- PacktPub.com -- Contributors -- Table of Contents -- Preface -- Chapter 1: Django and Patterns -- Why Django? -- The story of Django -- A framework is born -- Removing the magic -- Django keeps getting better -- How does Django work? -- What is a pattern? -- Gang of four patterns -- Is Django MVC? -- Fowler's patterns -- Are there more patterns? -- Patterns in this book -- Criticism of patterns -- How to use patterns -- Python Zen and Django's design philosophy -- Summary -- Chapter 2: Application Design -- How to gather requirements? -- Are you a storyteller? -- HTML mockups -- Designing the application -- Dividing a project into apps -- Reuse or roll-your-own? -- My app sandbox -- Which packages made it? -- Best practices before starting a project -- SuperBook - your mission, should you choose to accept it -- Why Python 3? -- Which Django Version to use -- Starting the project -- Summary -- Chapter 3: Models -- M is bigger than V and C -- The model hunt -- Splitting models.py into multiple files -- Structural patterns -- Patterns - normalized models -- Problem details -- Solution details -- Three steps of normalization -- First normal form (1NF) -- Second normal form (2NF) -- Third normal form (3NF) -- Django models -- Performance and denormalization -- Should we always normalize? -- Pattern - model mixins -- Problem details -- Solution details -- Model mixins -- Pattern - user profiles -- Problem details -- Solution details -- Signals -- Admin -- Multiple profile types -- Pattern - service objects -- Problem details -- Solution details -- Retrieval patterns -- Pattern - property field -- Problem details -- Solution details -- Cached properties -- Pattern - custom model managers -- Problem details -- Solution details -- Set operations on QuerySets -- Chaining multiple QuerySets -- Migrations
Django Design Patterns and Best Practices: Industry-standard web development techniques and solutions using Python
Title Django Design Patterns and Best Practices
URI https://ebookcentral.proquest.com/lib/[SITE_ID]/detail.action?docID=5405693
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwtV07T8MwELagZYAB8RTlpQixMEQ0sVPHIy0FJFCpUKm6VY4fCJACSh-Uf885TtMmEwwsUWLZifJ9ln13Pn9G6BxTTjFw62rtCZdE3HejMNCuWbHySMQ8mUoK9R9opxMOBqybHZw6So8ToHEczmbs81-phjIg22yd_QPd-UuhAO6BdLgC7XAtWcT5o2X8-o3HLx8wgpicDKO9b2J9VoK5CWN_Jk0kFkmDT3wKHnliQ6BXySReDgF4YSkE0OXifbwctirujbKuomd8XUyYPfCkPHCaacvmShTrFQWqSxNHns5XaLaKqj4JMKmg6m378fk-j3hh4z4RaoVOzQcvC-0KJv7mV5osINVLMvkezxen0zm_t4WqymwE2UYrKt5BG0vCjbvowmLtWKydOdYOYO0YrJ0c6z3Uv2n3WnduduiEy8GZBGAF9FrlKxo2tKwzKriKtGSRDDwuIsWYiHxdZ1KGVPiUSRoQqRoaMylCTTVheB9V4o9YHSAnICrQWITKGGpG6k35dej_PNANDoa0qCFn_svDdG08S8gdtpstY0k3GK6hsxIUQ6NxMixAd_ibSkdofdF3jlFlnEzUCVoT0_HrKDnNyPoB61wiew
linkProvider ProQuest Ebooks
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.title=Django+Design+Patterns+and+Best+Practices&rft.au=Ravindran%2C+Arun&rft.date=2018-01-01&rft.pub=Packt+Publishing+Limited&rft.isbn=9781788834971&rft_id=info:doi/10.0000%2F9781788834971&rft.externalDBID=n%2Fa&rft.externalDocID=9781788834971
thumbnail_l http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=9781788831345/lc.gif&client=summon&freeimage=true
thumbnail_m http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=9781788831345/mc.gif&client=summon&freeimage=true
thumbnail_s http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=9781788831345/sc.gif&client=summon&freeimage=true