Book: Create Your Online Store with Django

Video thumbnail

Creating an online store with Django isn't just a technical project, but an opportunity to understand how modern web architecture works.
In my experience, the key isn't in following mechanical steps, but in comprehending the logic behind each module, from product management to payment gateway integration.

Unlike other resources that teach how to build a “basic” eCommerce, here the goal is to create a scalable and modular application, designed for a professional environment and adaptable to other frameworks like Flask or FastAPI.
In fact, I apply this approach in my training, where we translate the same Django project to other environments to fully understand its structural advantages.

 

 

 

How to scale your store without breaking the architecture

 

  • Concrete strategies:
  • Abstract payment layer
  • Clean models
  • Decoupled views
  • Centralized configurations
  • Modular tests

 

It is recommended to purchase the course along with the book, since the course offers more detailed explanations about the reasoning behind things, while the book tends to be more general. This way, with the combination of both, you can have the complete experience.

This training is designed to be acquired as a package.

 

Why is Django ideal for an online store?

Django is one of the most complete Python frameworks: it offers security, modularity, and development speed.
Its “batteries included” architecture allows you to build robust applications from scratch without depending on external packages for every detail.

Its advantages for eCommerce include:

  • Powerful and stable ORM for handling products, carts, and users.
  • Integrated authentication system, ready to customize.
  • Django Admin, a magnificent tool for managing catalogs, orders, and users.
  • Real scalability, being able to integrate external services and handle high volumes of traffic.

In my case, what I value most is that Django makes it easy to keep the code clean and modular, which means each part of the project can evolve independently.

This training is aimed at those who want to learn to create an online store with Django or Python web in general, as the online store will also be implemented in other frameworks, specifically with Flask and Fast API to have the complete experience (meaning we will take the Django project and translate it into these frameworks, only the module for the end user -without the dashboard-). Initially we will use Django, which, by using Python, gives us the entire ecosystem it offers with the advantages of well-modular and scalable apps.

Additionally, we will port the same project (without the admin module) to other frameworks: Flask and Fast API. (To be done)

 

 

 

Why is Django ideal for creating an online store?

Security, modularity, and development speed

Django is famous for its batteries included philosophy: it brings everything you need to build a robust web application without getting tangled up installing 50 external packages. For an eCommerce this is pure gold: stable ORM, integrated authentication, solid sessions, secure forms, and a flexible template system.

My experience creating scalable stores with Django

In my experience, what makes the difference is not "following a step-by-step," but understanding why each part is there. When I started developing more complex stores, I discovered that Django allows you to keep the code modular from the start; for example, dividing the logic of product, payments, and users into completely independent apps. That modularity was the reason why I was later able to migrate a good part of the project to Flask and FastAPI without starting from scratch.

 

 

Project Architecture: Modular and Scalable

One of the pillars of this training is understanding how to structure a Django store thinking about the future and making it COMPLETELY modular and scalable.

Instead of a single, never-ending views.py file, we divide the project into small applications: blog, store, admin.

As you can imagine, the store app is the most interesting and we will create a layer system for the implementation of the payment gateway, making it TOTALLY modular:

  • Abstract product type class
  • Product type classes
  • Base classes that connect with the payment gateways and process the payment WITHOUT ADDING additional payment logic like PayPal and Stripe (This way you can add new gateways (MercadoPago, Redsys, etc.) without altering the rest of the system.).
  • Class that determines which payment gateway to use.
  • Class-based views for processing payments.

This is to name the most important part, but the templates will also be created in a modular way.

 

 

 

Payments in Django: the heart of the store

An online store is not complete without a reliable payment system.
In this course, I delve into how to create a global Payment entity that centralizes all the logic, avoiding duplication and errors, and this is the MOST IMPORTANT part, and the one we will spend the most time on, creating everything in detail, handling errors in a scalable way, generating logs, etc.

I learned that having an abstraction layer for payments is crucial. In a real project, we needed to integrate Stripe and PayPal simultaneously, and without this layer, the code became unmanageable.

In my experience, this modularity not only improves maintainability but also allows you to reuse parts of the code when migrating to frameworks like Flask or FastAPI.

 

 

 

Customization and Administration: Django Admin to the Rescue

Django Admin is not just a management tool; it is the backbone of the store's internal control.
It allows you to customize views, filters, and permissions to create a complete administration interface without writing a single line of frontend code.

Personally, I prefer to use Django Admin as a base rather than reinventing dashboards from scratch. It is a waste of time to repeat known processes when the business logic is what matters.

Among the customizations I teach:

  • Dynamic fields.
  • Custom filters.

Scalability and Maintenance: Thinking like a Professional

Creating an online store with Django doesn't end when the shopping cart works.
The key is to design with growth in mind:

  • Separating business logic from the presentation layer.
  • Centralizing payment and security configuration.
  • Project deployment.

When I ported this project to Flask and FastAPI, I noticed how Django was ahead in terms of order and consistency. It was an excellent lesson on the importance of long-term thinking from the start.

This resource is special when compared to other resources on my platform for the following reasons:

Key Points

Before you acquire this resource, please read the following points in which I discuss the differences we have with the rest of my courses for beginners:

  • Intermediate-professional level: It is assumed that the reader has at least basic knowledge of Django, ranging from the development tools used with VSC.
  • More specific: It is a book in which the objective is to create an online store type application with our knowledge in Django, therefore, it will not have the same focus as my other courses/books where the coding depends on the topic presented, and thus, the development will be shorter and more concise. Here the objective is solely the creation of the online store, therefore, the store is the topic and what we code depends on the goal to be met for the store.
  • Not step-by-step: It is important to emphasize the previous point, for this training, we DO NOT offer a step-by-step for EVERYTHING, meaning there are processes like dashboards, which many times we DO NOT implement from scratch, but rather the implementation is shown based on a presentation (course) and that is why we mention that it is for an intermediate-professional level.
    • We avoid wasting time on known processes like the ones mentioned, this way, the aim is for you to invest your time in the most important aspects, learning unique processes and logics.
  • Source code per section: As always, the source code will be available at the end of each section but it will NOT be public NOR available via GitHub.
  • Price: Being a course/book designed for Django developers and of a higher level, it also has a higher price than the rest of my basic training, also, the course is intended to be purchased along with the book.
  • Course and Book the best combination: It is designed to be acquired as both the course and the book, since, in the course, we often skip the development of repetitive modules, simply providing an explanation of what was done and not carrying out the development, this way, the goal is for YOU, the one who wants to improve their skills in Django and in Python web in general, to be able to learn more in the shortest possible time and therefore, you have a special price if you acquire them as a pair.

 

 

 

Training Syllabus

This book has a total of 8 chapters. It is recommended that you read in the order in which they are arranged and as we explain and develop components that form our application; immediately after, go directly to practice, replicate, test, and modify the codes that we show in this book; the book is currently under development.

  1. Chapter 1: We will create the project that we will carry out in the course.
  2. Chapter 2: We will create the main migrations and models that we are going to use in the application.
  3. Chapter 3: In this chapter, we will create the CRUD for the blog, that is, the posts, categories, tags, among others.
  4. Chapter 4: We will create the blog for the end user, paginated list with filters, and detail view.
  5. Chapter 5: We will create the Store with payment gateways for PayPal and Stripe for the end user, with its paginated lists with filters and detail view.
  6. Chapter 6: We will create an Online store for products instead of books to make it more generic.
  7. Chapter 7: In this section, we will apply several changes to the online store application, such as defining language, dark mode, improving the design, a module to view payments and user authentication (to be done).
  8. Chapter 8: Translate to Flask and Fast API (to be done)

 

 

Objective 

The training has two objectives:

  1. The creation of the online store with the basic options of making payment through Stripe and PayPal, easily scalable for other payment methods.
  2. Explaining and putting into practice crucial concepts so that you can implement (the why of things) and adapt the online store to your needs; concepts such as:
    1. Logic to handle payments in a centralized and scalable manner through a global entity called Payment.
    2. Why create a layer system for the payment gateway for scalability and maintenance.
    3. Using a generic product type entity or a specific one like the buyable entity.
    4. Customizing lists and details per product.
    5. We will use Django Admin for the management of our store.
       

Advantages of developing in Django and taking this training

  • It is excellent for creating applications when you require frequent client-server communication.
    • For this reason, it is ideal for creating this type of application, such as online stores that have a lot of interaction with the client and, consequently, with the server.
  • Thanks to Django offering excellent organization, it is a fast, powerful framework, with ready-to-use libraries and helpers, and extensible with third-party and framework-specific packages and libraries; in turn. It is a great all-in-one framework (batteries included) and it is a delight to program this type of software with it.
  • It is ideal for creating real, maintainable, and scalable applications.
  • You will learn to develop a modular and scalable application, which will allow you to improve your software development skills with a highly scalable and customizable real project that you can use as a base for your personal or professional projects.

You can see an app demo at:

I agree to receive announcements of interest about this Blog.

With this book, you'll learn how to create your own fully scalable and customizable online website with Django and a payment gateway using Stripe or PayPal.

Algunas recomendaciones:

Benjamin Huizar Barajas

Laravel Legacy - Ya había tomado este curso pero era cuando estaba la versión 7 u 8. Ahora con la ac...

Andrés Rolán Torres

Laravel Legacy - Cumple de sobras con su propósito. Se nota el grandísimo esfuerzo puesto en este cu...

Cristian Semeria Cortes

Laravel Legacy - El curso la verdad esta muy bueno, por error compre este cuando ya estaba la versi...

Bryan Montes

Laravel Legacy - Hasta el momento el profesor es muy claro en cuanto al proceso de enseñanza y se pu...

José Nephtali Frías Cortés

Fllask 3 - Hasta el momento, están muy claras las expectativas del curso

| 👤 Andrés Cruz

🇪🇸 En español