E-commerce Website With Django and Vue Tutorial (Django Rest Framework)

freeCodeCamp.org · 460K views · 2021 · 2:45:27

Open on YouTube

Web developmentPython, Ruby & scripting languagestutorial

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they were following when they hit specific Django, Vuex or serializer problems, so it serves as context for their questions.

Recommended by 0 people across 0 different months, 2021 to 2022.

What it is

A 2h45m freeCodeCamp course by CodeWithStein that builds a full e-commerce site with a Django REST Framework backend and a separate Vue frontend. It covers models, serializers, Vuex cart state, user accounts, Stripe payments and deployment.

What people said

Cites djangodjango · 2021-05 · Stack Overflow · on “Django - File name '' includes path elements exception, isn't the name supposed to include the path relative to MEDIA_ROOT?”

I am working through a Django/Vue tutorial [this video] . I have a url setup 'latest-products' that should show the serialized Products but I am getting an exception when the thumbnail doesn't exist and is created with the make_thumbnail function in the Product class of models.py. This is the exception: Exception Type: SuspiciousFileOperation at /api/v1/latest-products/ Exception Value: File name 'uploads/winter3.jpg' includes path elements This is the result I am expecting: screenshot [LINK] From the Django File documentation [LINK] , the name is supposed to be "The name of the file including the relative path from MEDIA_ROOT." So, my question is why am I getting a SuspiciousFileOperation except

Cites hans · 2021-09 · Stack Overflow · on “Does $store.state.x access the same object reference in Vuex when used in different components?”

I'm following a tutorial [this video] to create an eCommerce website using Vue Router and Vuex. When I do this.cart = this.$store.state.cart in different components, the cart variables seem to have the same object reference since the total item count in each component updates whenever it is changed in the other component even though no mutation has been committed (check the linked/timestamped video [this video] for demonstration). Is this the case here? I know that objects are passed by reference in JS but Vuex stores cannot be changed directly without committing a mutation, which would make it seem like the object is being duplicated in the background whenever the store is accessed. The two relevant

Cites Larry · 2022-07 · Stack Overflow · on “Django serializer.save() gives back a HTTP 500 error response”

I have the following straightforward setup: a folder order with a models.py file, from django.contrib.auth.models import User from django.db import models from product.models import Product class Order(models.Model): user = models.ForeignKey(User, related_name='orders', on_delete=models.CASCADE) first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) email = models.CharField(max_length=100) address = models.CharField(max_length=100) zipcode = models.CharField(max_length=100) place = models.CharField(max_length=100) phone = models.CharField(max_length=100) created_at = models.DateTimeField(auto_now_add=True) paid_amount = models.DecimalField(max_digits=8, de