{"id":256900,"date":"2026-07-13T15:08:08","date_gmt":"2026-07-13T12:08:08","guid":{"rendered":"https:\/\/1kitap1.com\/en\/create-your-online-store-with-django-5-andres-cruz-yoris\/"},"modified":"2026-07-13T15:08:08","modified_gmt":"2026-07-13T12:08:08","slug":"create-your-online-store-with-django-5-andres-cruz-yoris","status":"publish","type":"post","link":"https:\/\/1kitap1.com\/en\/create-your-online-store-with-django-5-andres-cruz-yoris\/","title":{"rendered":"Create Your Online Store With Django 5 &#8211; Andres Cruz Yoris"},"content":{"rendered":"<figure style=\"text-align:center;margin:0 auto 1.5em;\"><img decoding=\"async\" src=\"https:\/\/1kitap1.com\/en\/wp-content\/uploads\/2026\/07\/fcb1779085c371c3.jpg\" alt=\" - Unknown book cover\" style=\"max-width:300px;width:100%;height:auto;box-shadow:0 4px 12px rgba(0,0,0,.25);border-radius:4px;\"\/><\/figure>\n<p>Payments like PayPal and Stripe, which we&#8217;ll call BasePayment, will be handled in this class, leaving other classes like the book class, which we&#8217;ll create later, to inherit these classes and thus, the common behavior for processing payments through these payment gateways. This class will be the intermediate one and is responsible for selecting the payment gateway, checking if the product is already registered in the account, and any other validation we want to implement: PaymentView (PaymentBookView) >> BasePayment BasePaymentController >> PaymentPaypalClient BasePaymentController >> PaymentStripe Let&#8217;s start by creating the aforementioned intermediate class: djangoshopping\\store\\utils\\payment.py class BasePayment(PaymentPaypalClient): def process_order(self, order_id:str, type:str) -> bool: # EVERYTHING check that you DO NOT buy the same product twice if type == &#8216;paypal&#8217;: # Paypal self.process_order_paypal(order_id) elif type == &#8216;stripe&#8217;: # Stripe # self.stripe_check_payment(orderId) pass return True In this same file, we will copy the class that handles the PayPal payment and therefore, once done, we can delete the file that held the PaymentPaypalClient class (djangoshopping\\store\\utils\\paypal.py): djangoshopping\\store\\utils\\payment.py from django.conf import settings import requests class PaymentPaypalClient: def __init__(self): *** def __str__(self): return f&#8221;PayPalClient(base_url={self.base_url}, client_id= {self.client_id})&#8221; def process_order_paypal(self, order_id:str) -> bool: try: access_token = self.get_access_token() *** return True except Exception as e: return False def get_access_token(self) -> str: *** class BasePayment(PaymentPaypalClient): *** We also took advantage of this and renamed the process_order() method to process_order_paypal() so it can be easily reused.<\/p>\n<p>As you can see, both of these classes return a Boolean value indicating whether the transaction was successful or not. This makes handling the response much more straightforward and makes error handling easier, as we&#8217;ll address later. Now, we&#8217;ll use this new class from the payment view, which we&#8217;ll rename to: djangoshopping\\store\\views.py from .utils.payment import BasePayment *** class PaymentBookView(LoginRequiredMixin, View, BasePayment): We updated the routes: djangoshopping\\store\\urls.py path(&#8216;payment\/<str:order_id>\/<int:book_id>\/<str:type>&#8216;, PaymentBookView.as_view(), name=&#8217;s.payment&#8217;), As you can see, we added an additional parameter corresponding to the type of gateway used, whether PayPal or Stripe.<\/p>\n<blockquote>\n<p>Post about the book! Por favor ayuda a promocionar este libro. El post sugerido para este libro es: \u00a1Acabo de comprar el libro &#8220;Crea tu Tienda en L\u00ednea con Django&#8221; de @LibreDesarrollo! Get your copy at: https:\/\/www.desarrollolibre.net\/libros\/create-your-online-store-with- Django OceanofPDF.com About the author This book was written by Andr\u00e9s Cruz Yoris, a graduate in Computer Science with over 10 years of experience developing web applications in general. I work with PHP, Python, and client-side technologies such as HTML, JavaScript, CSS, Vue, and others; and server-side technologies such as Laravel, Flask, Django, and CodeIgniter.<\/p>\n<p>I&#8217;m also a developer in Android Studio, xCode, and Flutter for creating native applications for Android and iOS. I share some of my learning experience with you, reflected in each of the words that make up this book, my second book on Django; this time a more advanced, mid-professional-level book. OceanofPDF.com Copyright No part of this book may be reproduced or transmitted in any form\u2014 including electronic copies or photocopies\u2014without the author&#8217;s permission. OceanofPDF.com Prologue Django is a framework with many options. It allows us to create applications with the latest Python language, a modular programming language with impeccable syntax that can also be used in a web environment.<\/p>\n<p>It offers a modular approach between projects and applications, a significant set of packages to extend the already comprehensive framework, and thus, the creation of scalable projects. It&#8217;s a framework that, by using Python, brings with it the benefits of a clean, clear, and precise syntax, a modular environment, and scalability through packages. In this book, we&#8217;ll learn how to use the most famous web framework for Python, Django, and how we can leverage it to create modern and scalable applications, taking advantage of the benefits of both the framework and Python.<\/p>\n<p>In short, you&#8217;ll have a wealth of material at your disposal to create real web applications. OceanofPDF.com Who is this book for? Este libro est\u00e1 dirigido para personas que tengan al menos conocimientos medios en Django, enti\u00e9ndase que NO es una formaci\u00f3n b\u00e1sica, para ello, est\u00e1n en resto de mis formaciones: https:\/\/www.desarrollolibre.net\/libros\/get-started-with-django And the purpose of this book is to create a fully modular, scalable, and functional online store.<\/p>\n<p>For this reason, the approach of this training is more accelerated since it assumes the reader is a Django developer and capable of creating at least simple applications within the framework. For those who want to learn something new, to learn about a tool with little documentation and most of it in English. For those who want to improve a web development skill, who want to grow as a developer. For those who want to create a real, functional project like an online store, which is the second step once you know how to use Django.<\/p>\n<p>If you identify with at least some of the points mentioned above, this book is for you.<\/p>\n<\/blockquote>\n<p><em>This is a short excerpt from the opening of &ldquo;&rdquo; by Unknown, quoted for review and introduction purposes. All rights belong to the copyright holders.<\/em><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/1kitap1.com\/en\/create-your-online-store-with-django-5-andres-cruz-yoris\/#Book_Information\" >Book Information<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/1kitap1.com\/en\/create-your-online-store-with-django-5-andres-cruz-yoris\/#Reading_Word_Statistics\" >Reading &amp; Word Statistics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/1kitap1.com\/en\/create-your-online-store-with-django-5-andres-cruz-yoris\/#Most_Frequent_Words\" >Most Frequent Words<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/1kitap1.com\/en\/create-your-online-store-with-django-5-andres-cruz-yoris\/#PDF_Download\" >PDF Download<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Book_Information\"><\/span>Book Information<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Unique ID:<\/strong> fcb1779085c371c3<\/li>\n<li><strong>File Extension:<\/strong> .pdf<\/li>\n<li><strong>File Size:<\/strong> 5,306,870 bytes (5.061 MB)<\/li>\n<li><strong>Title:<\/strong> &#8211;<\/li>\n<li><strong>Author:<\/strong> Unknown<\/li>\n<li><strong>Pages:<\/strong> 389<\/li>\n<li><strong>Language:<\/strong> English (en)<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Reading_Word_Statistics\"><\/span>Reading &amp; Word Statistics<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Estimated Reading Time:<\/strong> 174.18 minutes<\/li>\n<li><strong>Total Words:<\/strong> 34,835<\/li>\n<li><strong>Total Characters:<\/strong> 296,675<\/li>\n<li><strong>Average Words per Page:<\/strong> 89.55<\/li>\n<li><strong>Average Characters per Page:<\/strong> 762.66<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Most_Frequent_Words\"><\/span>Most Frequent Words<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>class (592), payment (471), self (328), store (310), div (286), djangoshopping (278), paypal (274), url (265), get (250), html (245), coupon (245), book (221), product (219), django (216), stripe (210), order (210), request (209), create (198), post (193), use (192), templates (184), user (179), type (169), return (160), error (153), name (151), models (147), price (137), title (134), def (128), views (123), blog (116), path (112), template (112), import (110), str (110), view (108), session (105), dark (99), category (98), process (98), context (97), client (96), data (93), settings (92), admin (91), we&#8217;ll (90), like (90), using (89), one (87), account (87), content (83), python (82), https (81), language (81), tailwind (81), option (78), application (77), css (76), method (76), true (76), com (75), project (73), json (73), payments (68), tag (68), model (68), fragment (67), form (66), code (66), key (66), step (65), slug (64), static (64), see (62), kwargs (62), src (62), show (61), index (61), define (61), orderid (61), section (60), value (60), following (59), example (59), date (59), null (58), status (57), flex (57), install (56), href (55), response (55), success (55), entity (54), endif (54), it&#8217;s (53), login (53), theme (53), used (52), base (52).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"PDF_Download\"><\/span>PDF Download<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align:center;\"><a href=\"https:\/\/1kitap1.com\/en\/wp-content\/uploads\/2026\/07\/create-your-online-store-with-django-5-andres-cruz-yoris.pdf\" download rel=\"nofollow\" style=\"display:inline-block;background:#2271b1;color:#ffffff;padding:14px 36px;border-radius:6px;text-decoration:none;font-weight:bold;font-size:1.05em;\">&#11015;&#65039; PDF Download<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Payments like PayPal and Stripe, which we&#8217;ll call BasePayment, will be handled in this class, leaving other classes like the book class, which we&#8217;ll create later, to inherit these classes and thus, the common behavior for processing payments through these payment gateways. This class will be the intermediate one and is responsible for selecting the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":256898,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-256900","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-english"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts\/256900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/comments?post=256900"}],"version-history":[{"count":0,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/posts\/256900\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/media\/256898"}],"wp:attachment":[{"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/media?parent=256900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/categories?post=256900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1kitap1.com\/en\/wp-json\/wp\/v2\/tags?post=256900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}