Learn Python and the Django Framework by building a e-commerce website

Overview

veryacademy

Django E-commerce Tutorial Series

Learn Python and the Django Framework by building a e-commerce website
The Django E-commerce project is an open-source initiative and tutorial series. Learn from a beginner level how to build an e-commerce website.

Please join our active, growing community:
Website (Coming Soon) | Twitter | YouTube

Aims of this course

The aims of this course is to:

  • learn the Django framework
  • learn how to build, test and deploy a Django application

Course Introduction

The Django E-commerce Tutorial Series is designed for students who wants to learn the Django Framework by building an e-commerce application. This course is a great way to start learning Python and the Django Framework. We start from a beginners level slowly moving into more advanced topics. I have tried to design this course to be modular so that you could also focus in on particular subjects, tutorials or aspects of Django should you prefer this mode of learning.

On this course you will be taught a wide range of skills, here are a few topics that we will be learning:

  • Django URLs, models, views
  • Django Templating
  • Introduction to Unittest
  • Testing with Pytest
  • Working with Django and Docker
  • Deploying Django Applications

Tutorials

The tutorials, found here on our YouTube channel take you through the steps of developing an e-commerce application with Python Django, predominately deploying the Django template system.

Prerequisites

  • Install Python onto your PC/Laptop
  • Optional - Visual Studio Code Editor
  • Tutorials use Windows OS (you can use other OS but it might require additional steps not detailed in the tutorials)

Who is this course for

This course tries to cater for many types of learners:

  • new developers,
  • not so new developers,
  • degree students,
  • Everyone else who is looking to learn Django

Course Content

Part-1 Building models, views and testing
This first tutorial is most definitely aimed at Django beginners where we cover the basics of developing Django views, URLS, models and get started with testing our application. By the end of this tutorial you will have a working product catalogue which will form the basis of our e-commerce application.

Link to Tutorial https://youtu.be/UqSJCVePEWU
Part-2 Build an e-commerce basket with session handling
In this tutorial we go through the process of building a shopping basket using sessions to handle managing data anonymous connections, saving products into a shopping cart in preparation to be purchased. We implement Ajax to handle the front-end and work through stage by stage the functionality needed to save, update and delete the basket data.

Link to Tutorial https://youtu.be/VOwfGW-ZTIY
Part-3 Build a user, payment and order management system
In this tutorial we go through the process of building the user functions needed to allow users to login and manage their account. We then work through building a payment system using stripe and finally create an ordering backend to capture the customer orders.

Link to Tutorial https://youtu.be/ncsCnC3Ynlw
Part-4 Refactoring the E-commerce Store Templates
In this tutorial we go through the process of refactoring the templates in our project.

Link to Tutorial https://youtu.be/S9-aRoLrs7U
Part-5 Multi-Product Types Database Implementation
In this tutorial we go through the process of developing a database for multiple products with multiple attributes.

Link to Tutorial https://youtu.be/hGg13rzvoNY
Part-6 Managing multiple addresses CRUD and UUID
In this tutorial we go through the process of further normalizing the accounts table to allow users to save more than one address. We build in Django a new address table and then start to update the UI in the dashboard, finally we work through a simple CRUD feature with Django views.

Link to Tutorial https://youtu.be/8SP76dopYVo
Part-7 E-commerce Customer Wish List
In this tutorial we go through the process of building a purely Django user wish list to allow users to create a list of favorite products.

Link to Tutorial https://youtu.be/OgA0TTKAtqQ
Part-8 PayPal Integration
In this tutorial we go through the first steps of integrating PayPal into our e-commerce store.

Link to Tutorial https://youtu.be/smSl2ahkfNw
Part-9 Refactor Folder Structure & Pytest Introduction
In this Django tutorial we discuss Django folder structures and prepare our application ready for scaling further. We prepare the app for the next step of testing, installing Pytest and I take you through the first steps of working with Pytest to test your application.

Link to Tutorial https://youtu.be/ZE7dM0XmUoA
Part-10 Pytest Testing 1
In this Django tutorial we start to test with Pytest, Factory Boy the apps we have build previously.

Link to Tutorial

Community Driven Content

I activity try and promote feedback to taylor courses to your needs and wishes. Here is a list of features requested by community. If you would like to request any other feature not listed here - please visit our YouTube channel and make a comment.

Next Planned Tutorials

  • Tests for whole system

Introduction Phase Suggestions

  • Create Data fixtures (if possible community support for multiple languages)
  • Setup or custom commands for project initial setup
  • Documentation - Class Diagrams and Sequence Diagrams
  • Basic/different search techniques
  • Product Tags/Search
  • Email payment confirmation and PDF receipts
  • Product filter searching
  • Rating / Feedback
  • Coupon System

Intermediate Level Suggestions

  • Internationalization
  • Change to CBV (or not - up to you)
  • PostgreSQL (via Docker)
  • Custom admin views and management tasks
  • Managing sales or season sales
  • Store locator to your project
  • Email list + bulk emailing
  • Notifications
  • Request quotations for bulk orders

Advanced Level Suggestions

  • Haystack / Elasticsearch
  • User Recommendations/Recommender systems
  • Cache
  • Live Chat - Help/Support (Channels)
  • Processing / working with images (compression etc)
  • Generating product statistics
  • Allow users to sell products

Deployment Suggestions

  • Docker deployment configuration
  • Heroku deployment
  • Digital Ocean deployment

Contributing

This course welcomes contributions and suggestions. At present, we are not accepting any code contributions. When the tutorials have finished the project will be open to welcome code contributions. If you find any errors or have trouble with any of our code - please get in contact with us through our YouTube channel.

Instructor

Zander, the founder of Very Academy has over 20 years of development and educational lecturing experience. He is now focused on developing free technical courses and resources on a range of subjects.

License

MIT License

Comments
  • No Product matches the given query.

    No Product matches the given query.

    I feel embarassed to ask this question as I have solved this type of problem many times, but on this occasion I have failed. I was unable to determine the cause of this and despite copying the code from this repo, this error still persists. All url.py files and views.py are identical. I've been struggling for two days now and just cannot see the error. I'd be grateful for some assistance. Apologies but I really can't figure out how this issue tracker works and to me seems rather antiquated. I've wasted a lot of time trying to format this without any luck. Nothing works as expected. Anyway:-

    Page not found (404) No Product matches the given query.

    Request Method: GET Request URL : http://localhost:8000/basket` Raised By : store.views.product_detail Using the URLconf defined in core.urls Django tried these URL patterns, in this order:core.urls Django tried these URL patterns, in this order:

    1 - basket/
    2 - [name='product_all']
    3 - [name='product_detail']
    

    The current path, basket, matched the last one.

    This view is supposed to be raising the problem but I can't see why it would be...

    def product_detail(request, slug): product = get_object_or_404(Product, slug=slug, in_stock=True) return render(request, 'store/products/single.html', {'product': product})

    from django.urls import path

    from . import views

    app_name = 'store'

    urlpatterns = [ path('', views.product_all, name='product_all'), path('slug:slug', views.product_detail, name='product_detail'), path('shop/slug:category_slug/', views.category_list, name='category_list'), ] `

    1 - basket/
    2 - [name='product_all']
    3 - [name='product_detail']
    

    The current path, basket, matched the last one.

    This view is supposed to be raising the problem but I can't see why it would be...

    `from django.shortcuts import get_object_or_404, render

    from .models import Category, Product

    def product_all(request): products = Product.products.all() return render(request, 'store/home.html', {'products': products})

    def category_list(request, category_slug=None): category = get_object_or_404(Category, slug=category_slug) products = Product.objects.filter(category=category) return render(request, 'store/products/category.html', {'category': category, 'products': products})

    def product_detail(request, slug): product = get_object_or_404(Product, slug=slug, in_stock=True) return render(request, 'store/products/single.html', {'product': product})'

    My store/urls.py:

    `from django.urls import path

    from . import views

    app_name = 'store'

    urlpatterns = [ path('', views.product_all, name='product_all'), path('slug:slug', views.product_detail, name='product_detail'), path('shop/slug:category_slug/', views.category_list, name='category_list'), ]`

    My core/urls.py:

    `from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import include, path

    urlpatterns = [ path('basket/', include('basket.urls', namespace='basket')), path('', include('store.urls', namespace='store')), path('admin/', admin.site.urls), ]

    if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)`

    opened by DaveJ61 2
  • Error     raise NodeNotFound

    Error raise NodeNotFound

    gh

    i was following your tutorial i tried to download to the 3rd part code but it raise this error while running btw thanks your knowledge about django is awesome

    opened by whoislimshady 2
  • Update urls.py

    Update urls.py

    Issue: URL Path for activate containing an extra ")" due to which redirect not working for dashboard.

    Fix: Removed ")" from URL path for account_activate

    opened by Sanju6895 1
  • changed in the Part-03 User Payment and Order Management in final

    changed in the Part-03 User Payment and Order Management in final

    Hello sir, I am learning from your YouTube video and also referring your repositories, I found one mistake their that you did not changed in your repositories code but you teach that part in video so I add that code in Part-03 User Payment and Order Management/Final/account/urls.py /

    So please make sure I'm added the right code and please add it for other learners. You are great Teacher please keep it up Thank you

    opened by Patil-Dipak 0
  • Superuser creation error in Part-01 Django Models Views and Testing

    Superuser creation error in Part-01 Django Models Views and Testing

    The code in Part-01 Django Models Views and Testing/Part-1 Initial/store/admin.py produces the following error when attempting to create a superuser:

    <class 'store.admin.ProductAdmin'>: (admin.E116) The value of 'list_filter[1]' refers to 'is_active', which does not refer to a Field.

    opened by UnityTAW 0
  • clean_username should be clean_user_name

    clean_username should be clean_user_name

    I noticed that on part3/final/account/forms.py on line 35 the validation was not working. it seems to be working because of the django default validation but clean_username() function is not called upon validation on view. The fix should be:

    clean_username(self): ↓ clean_user_name(self):

    opened by Yukinosuke-Takada 1
  • Part-05: category__in filters name=category_slug throws exception when slug is different from name

    Part-05: category__in filters name=category_slug throws exception when slug is different from name

    in store>view.py line 13

    category__in=Category.objects.get(name=category_slug).get_descendants(include_self=True)

    should most likely be

    category__in=Category.objects.get(name=category).get_descendants(include_self=True)

    if the slug and the category name does not match, it throws and exception in the original code. The category name is already retrieved in line 13.

    opened by BjornHeller 0
  • problematic apps/account/urls.py

    problematic apps/account/urls.py

    The problem is with this line:

    path("activate/slug:uidb64/slug:token)/", views.account_activate, name="activate")

    The problem is not obvious with console email emulator, if you copy and use the link as is. But the url ending in characters which are not url-safe (specifically ')/' is manifest when sending an actual email - the url in the email text will be displayed in full, but the browser will cut the unsafe characters from the link, and thus the link will always be broken

    opened by alexakarpov 0
  • error in activation-related try/except

    error in activation-related try/except

    This is the block we have here in account/views.py:

        try:
            uid = force_text(urlsafe_base64_decode(uidb64))
            user = Customer.objects.get(pk=uid)
        except (TypeError, ValueError, OverflowError, user.DoesNotExist):
      
    

    same block is present in pre-refactorin lectures, starting with Part 04, and up to including Part 10.

    obviously, 'user', being a regular variable, doesn't have the DoesNotExist on it. If we replace the lower-case 'user' with, say, Customer (after we've created the class), the error goes away. Python being so dyamic and lenient is a double-edged sword )

    opened by alexakarpov 0
  • template base.html unresolved variable

    template base.html unresolved variable

    I don't know, exactly, why the site keeps working, but once I've enabled debug logging server-side, there came in a flood of messages pointing to the same problem on lines 46 and 125:

               <li {% if category.slug == c.slug %}class="selected" {% endif %}>
                  <a class="dropdown-item" href="{{ c.get_absolute_url }}">{{ c.name|title }}</a>
    

    , where 'category' variable does not exist. The code above is taken from Chapter 10.

    opened by alexakarpov 2
Owner
Very Academy
Open source project initiatives, code samples, video and written tutorials
Very Academy
A simple E-commerce shop made with Django and Bulma

Interiorshop A Simple E-Commerce app made with Django Instructions Make sure you have python installed Step 1. Open a terminal Step 2. Paste the given

Aditya Priyadarshi 3 Sep 3, 2022
Domain-driven e-commerce for Django

Domain-driven e-commerce for Django Oscar is an e-commerce framework for Django designed for building domain-driven sites. It is structured such that

Oscar 5.6k Jan 1, 2023
django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the dashboard framework Dashing

django-dashing django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project.

talPor Solutions 703 Dec 22, 2022
An insecure login and registration website with Django.

An insecure login and registration website with Django.

Luis Quiñones Requelme 1 Dec 5, 2021
Django app for building dashboards using raw SQL queries

django-sql-dashboard Django app for building dashboards using raw SQL queries Brings a useful subset of Datasette to Django. Currently only works with

Simon Willison 383 Jan 6, 2023
A simple demonstration of how a django-based website can be set up for local development with microk8s

Django with MicroK8s Start Building Your Project This project provides a Django web app running as a single node Kubernetes cluster in microk8s. It is

Noah Jacobson 19 Oct 22, 2022
Website desenvolvido em Django para gerenciamento e upload de arquivos (.pdf).

Website para Gerenciamento de Arquivos Features Esta é uma aplicação full stack web construída para desenvolver habilidades com o framework Django. O

Alinne Grazielle 8 Sep 22, 2022
This is a personal django website for forum posts

Django Web Forum This is a personal django website for forum posts It includes login, registration and forum posts with date time. Tech / Framework us

null 5 May 12, 2022
An airlines clone website with django

abc_airlines is a clone website of an airlines system the way it works is that first you add flights to the website then the users can search flights

milad 1 Nov 16, 2021
ProjectManagementWebsite - Project management website for CMSC495 built using the Django stack

ProjectManagementWebsite A minimal project management website for CMSC495 built

Justin 1 May 23, 2022
PicoStyle - Advance market place website written in django

Advance market place website written in django :) Online fashion store for whole

AminAli Mazarian 26 Sep 10, 2022
Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project

Django URL Shortener Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project Install this package to your Dja

Rishav Sinha 4 Nov 18, 2021
APIs for a Chat app. Written with Django Rest framework and Django channels.

ChatAPI APIs for a Chat app. Written with Django Rest framework and Django channels. The documentation for the http end points can be found here This

Victor Aderibigbe 18 Sep 9, 2022
Bringing together django, django rest framework, and htmx

This is Just an Idea There is no code, this README just represents an idea for a minimal library that, as of now, does not exist. django-htmx-rest A l

Jack DeVries 5 Nov 24, 2022
RestApi With Django 3.2 And Django Rest Framework

RestApi-With-Django-3.2-And-Django-Rest-Framework Description This repository is a Software of Development with Python. Virtual Using pipenv, virtuale

Daniel Arturo Alejo Alvarez 6 Aug 2, 2022
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs

Fast to learn, fast to code, fast to run Django Ninja - Fast Django REST Framework Django Ninja is a web framework for building APIs with Django and P

Vitaliy Kucheryaviy 3.8k Jan 1, 2023
django-reversion is an extension to the Django web framework that provides version control for model instances.

django-reversion django-reversion is an extension to the Django web framework that provides version control for model instances. Requirements Python 3

Dave Hall 2.8k Jan 2, 2023
Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.

Cookiecutter Django Powered by Cookiecutter, Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly. Documentati

Daniel Feldroy 10k Dec 31, 2022
A handy tool for generating Django-based backend projects without coding. On the other hand, it is a code generator of the Django framework.

Django Sage Painless The django-sage-painless is a valuable package based on Django Web Framework & Django Rest Framework for high-level and rapid web

sageteam 51 Sep 15, 2022