{"id":62,"date":"2025-01-30T19:07:10","date_gmt":"2025-01-30T19:07:10","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/?p=62"},"modified":"2025-01-30T19:07:10","modified_gmt":"2025-01-30T19:07:10","slug":"wrangling-django","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/2025\/01\/30\/wrangling-django\/","title":{"rendered":"Wrangling Django"},"content":{"rendered":"\n<h3 class=\"wp-block-heading has-text-align-center\">The Backend<\/h3>\n\n\n\n<p>Wrestling with the source code of AgBiz Logic has been a phenomenal experience in discovering the structure of a big, foreign codebase. The first few spelunking expeditions into the project were akin to wandering around the New York subway system with a blindfold on. I attempted to trace information as it wound its way through the Django backend, across multiple modules, models, serializers, views,  and templates.<\/p>\n\n\n\n<p>Slowly, and after quite a few meetings with our project leader, a method to the madness began to take shape. Django lets developers implement quite robust versions of the classic Model-View-Controller (MVC) design pattern. The framework itself puts a bit of a spin on MVC though, which took me some time to untangle. Rather than using a Django ViewSet as a method of displaying content, the framework uses Templates to serve up information that should be displayed. The ViewSet, instead, becomes a type of controller, wherein the logic for interacting with the application&#8217;s database is housed. This confusing relationship often leads to Django&#8217;s design paradigm being labeled as Model-View-Template (MVT). <\/p>\n\n\n\n<p>Understanding this structure, and how the project&#8217;s AngularJS frontend can make API calls to Django, was key to my recent development progress. Currently, I&#8217;m working on a ViewSet function which queries the AgBiz database for agricultural chemicals used in a given farm plan. While it sounds simple enough, the next great hurdle will be to come to grips with the database schema. Then, working with the Models in the project, I will be able to query my way to the desired information. <\/p>\n\n\n\n<p>The chance to dive headfirst into a fully functional, industry software project has been wonderful. Though completely overwhelming at times, the experience will help to further hone my burgeoning development skills. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Backend Wrestling with the source code of AgBiz Logic has been a phenomenal experience in discovering the structure of a big, foreign codebase. The first few spelunking expeditions into the project were akin to wandering around the New York subway system with a blindfold on. I attempted to trace information as it wound its [&hellip;]<\/p>\n","protected":false},"author":14481,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-62","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/posts\/62","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/users\/14481"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/posts\/62\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/capstonejourney\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}