Learn Python and Django - Build an eCommerce Website Step by Step from Scratch
Why Stack Overflow recommends it
Stack Overflow users link it when answering or asking about Django and Stripe integration issues, such as setting up Stripe keys, subscriptions and static or media files in a similar eCommerce project.
Recommended by 1 people across 1 different months, 2017 to 2018.
What it is
A 3.5-hour beginner course on building an eCommerce site with Python and Django, covering Bootstrap templates, Stripe payments, a Gmail-backed contact form and deployment on PythonAnywhere. It is a step-by-step project walkthrough that assumes no prior programming experience, uploaded by the Help People channel.
What people said
Recommends Diiru · 2017-01 · Stack Overflow · on “How to create stripe_id on subscription?”
You are defining stripe_id in the class Profile, yet this should be assigned outside it. Try setting stripe.api_key = settings.STRIPE_SECRET_KEY above all the rest of the code. This is also perfectly explained in this youtube video: [this video] For example, this is a models.py that I created for a similar project: from __future__ import unicode_literals from django.conf import settings from django.db import models from allauth.account.signals import user_logged_in, user_signed_up import stripe # Create your views here. stripe.api_key = settings.STRIPE_SECRET_KEY # Create your models here. class profile(models.Model): name = models.CharField(max_length=120) user = models.OneToOneField(settings.AU
Cites Jolyon Loo · 2017-04 · Stack Overflow · on “Stripe Integration Error with Django”
I was following a tutorial [this video] on django ecommerce and encountered a 404 error while trying to test out the Stripe application. Specifically, I was redirected to ' [LINK] ' upon submitting a test payment. in views.py def checkout(request): publishKey = settings.STRIPE_PUBLISHABLE_KEY if request.method == 'POST': token = request.POST['stripeToken'] try: charge = stripe.Charge.create( amount=1000, currency="gbp", description="Example charge", source=token, ) except stripe.error.CardError as e: pass context ={'publishKey': publishKey} template = 'checkout.html' return render(request,template,context) in checkout.html: {% block strip %} <script type="text/javascript"> Stripe.setPublishableKe
Cites Sarath_Mj · 2018-02 · Stack Overflow · on “Django Cannot get media images or files”
setting.py STATIC_URL = '/static/' if DEBUG: MEDIA_URL = '/media/' STATIC_ROOT=os.path.join(os.path.dirname(BASE_DIR),"static","static-only") MEDIA_ROOT=os.path.join(os.path.dirname(BASE_DIR),"static","media") STATICFILES_DIRS=[ os.path.join(os.path.dirname(BASE_DIR), "static", "static") ] make above changes in setting.py to get static files and media files for your Django project Static files for storing JS and css files. media files for storing images Staticonly for storing cache files which will create and stored here automatically when you run collectstatic To load image inside the template <img src="/media/wwww.jpg" class="img-responsive" if you still getting confused to make this comme