Skip to main content
Apress

Decoupled Django

Understand and Build Decoupled Django Architectures for JavaScript Front-ends

  • Book
  • © 2021

Overview

  • Gives the reader a complete overview of the architecture of a decoupled Django project
  • Guides the reader to integrating GraphQL in a Django project
  • Guides the reader through the different tools and approaches for testing a decoupled Django project

This is a preview of subscription content, log in via an institution to check access.

Access this book

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

eBook USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

') var buybox = document.querySelector("[data-id=id_"+ timestamp +"]").parentNode var buyboxMaxSingleColumnWidth = 480 // springerPlus roll out 10% starts here var springerPlusGroup = setLocalStorageSpringerPlus(); var rollOutSpringerPlus = springerPlusGroup === "B" function setLocalStorageSpringerPlus() { var selectUserKey = "springerPlusRollOut"; var springerPlusGroup = "X"; if (!window.localStorage) return springerPlusGroup; try { var selectUserValue = window.localStorage.getItem(selectUserKey) springerPlusGroup = selectUserValue || randomDistributionSpringerPlus(selectUserKey) } catch (err) { console.log(err) } return springerPlusGroup; } function randomDistributionSpringerPlus(selectUserKey) { var randomGroup = Math.random() < 0.7 ? "A" : "B" window.localStorage.setItem(selectUserKey, randomGroup) return randomGroup } if (rollOutSpringerPlus) { revealSpringerPlus(); } function revealSpringerPlus() { if(buybox) { document.querySelectorAll(".c-springer-plus").forEach(function(node) { node.style.display = "block" }) } } //springerPlus ends here ;[].slice.call(buybox.querySelectorAll(".buying-option")).forEach(initCollapsibles) function initCollapsibles(buyingOption, index) { var toggle = buyingOption.querySelector(".buying-option-price") buyingOption.classList.remove("expanded") var form = buyingOption.querySelector(".buying-option-form") var priceInfo = buyingOption.querySelector(".price-info") if (toggle && form && priceInfo) { toggle.setAttribute("role", "button") toggle.setAttribute("tabindex", "0") toggle.addEventListener("click", function (event) { var expandedBuyingOptions = buybox.querySelectorAll(".buying-option.expanded") var buyboxWidth = buybox.offsetWidth ;[].slice.call(expandedBuyingOptions).forEach(function(option) { if (buyboxWidth <= buyboxMaxSingleColumnWidth && option != buyingOption) { hideBuyingOption(option) } }) var expanded = toggle.getAttribute("aria-expanded") === "true" || false toggle.setAttribute("aria-expanded", !expanded) form.hidden = expanded if (!expanded) { buyingOption.classList.add("expanded") } else { buyingOption.classList.remove("expanded") } priceInfo.hidden = expanded }, false) } } function hideBuyingOption(buyingOption) { var toggle = buyingOption.querySelector(".buying-option-price") var form = buyingOption.querySelector(".buying-option-form") var priceInfo = buyingOption.querySelector(".price-info") toggle.setAttribute("aria-expanded", false) form.hidden = true buyingOption.classList.remove("expanded") priceInfo.hidden = true } function initKeyControls() { document.addEventListener("keydown", function (event) { if (document.activeElement.classList.contains("buying-option-price") && (event.code === "Space" || event.code === "Enter")) { if (document.activeElement) { event.preventDefault() document.activeElement.click() } } }, false) } function initialStateOpen() { var buyboxWidth = buybox.offsetWidth var narrowBuyboxArea = buyboxWidth <= buyboxMaxSingleColumnWidth var allOptionsInitiallyCollapsed = buybox.className.indexOf("all-options-initially-collapsed") > -1 ;[].slice.call(buybox.querySelectorAll(".buying-option")).forEach(function (option, index) { var toggle = option.querySelector(".buying-option-price") var form = option.querySelector(".buying-option-form") var priceInfo = option.querySelector(".price-info") if (allOptionsInitiallyCollapsed || narrowBuyboxArea && index > 0) { toggle.setAttribute("aria-expanded", "false") form.hidden = "hidden" priceInfo.hidden = "hidden" } else { toggle.click() } }) } initialStateOpen() if (window.buyboxInitialised) return window.buyboxInitialised = true initKeyControls() })()

Other ways to access

Licence this eBook for your library

Institutional subscriptions

About this book

Apply decoupling patterns, properly test a decoupled project, and integrate a Django API with React, and Vue.js. This book covers decoupled architectures in Django, with Django REST framework and GraphQL. With practical and simple examples, you’ll see firsthand how, why, and when to decouple a Django project. 

Starting with an introduction to decoupled architectures versus monoliths, with a strong focus on the modern JavaScript scene, you’ll implement REST and GraphQL APIs with Django, add authentication to a decoupled project, and test the backend. You’ll then review functional testing for JavaScript frontends with Cypress. You will also learn how to integrate GraphQL in a Django project, with a focus on the benefits and drawbacks of this new query language.

By the end of this book, you will be able to discern and apply all the different decoupling strategies to any Django project, regardless of its size.



What You'll Learn  

  • Choose the right approach for decoupling a Django project
  • Build REST APIs with Django and a Django REST framework
  • Integrate Vue.js and GraphQL in a Django project
  • Consume a Django REST API with Next.js
  • Test decoupled Django projects


Who This Book Is For


Software developers with basic Django skills keen to learn decoupled architectures with Django. JavaScript developers interested in learning full-stack development and decoupled architectures with Django.


Similar content being viewed by others

Keywords

Table of contents (12 chapters)

Authors and Affiliations

  • Colle di Val D’Elsa, Italy

    Valentino Gagliardi

About the author

Valentino Gagliardi is a freelance consultant with a wealth of experience in the IT industry. He spent the last 8 years as a front-end consultant, providing advice and help, coaching and training on JavaScript and React. He worked as an instructor for multiple training agencies around the country, running in-person workshops and creating learning paths for aspiring developers. He loves to share his knowledge on his blog with tutorials reaching over 100,000  monthly visits. An avid Django user, he is active in the Python community as a speaker, and as a coach for Django Girls.

Bibliographic Information

  • Book Title: Decoupled Django

  • Book Subtitle: Understand and Build Decoupled Django Architectures for JavaScript Front-ends

  • Authors: Valentino Gagliardi

  • DOI: https://doi.org/10.1007/978-1-4842-7144-5

  • Publisher: Apress Berkeley, CA

  • eBook Packages: Professional and Applied Computing, Apress Access Books, Professional and Applied Computing (R0)

  • Copyright Information: Valentino Gagliardi 2021

  • Softcover ISBN: 978-1-4842-7143-8Published: 03 July 2021

  • eBook ISBN: 978-1-4842-7144-5Published: 02 July 2021

  • Edition Number: 1

  • Number of Pages: XX, 236

  • Number of Illustrations: 22 b/w illustrations

  • Topics: Python, Web Development

Publish with us

Navigation