ModuleNotFoundError: нет модуля с именем 'stripe' - PullRequest
0 голосов
/ 01 мая 2019

ModuleNotFoundError: Нет модуля с именем 'stripe' Даже у меня есть импорт в мои views.py fle

from django.shortcuts import render
from django.http import HttpResponse,HttpResponseRedirect
from django.conf import settings
import stripe

STRIPE_PUBLISHABLE_KEY1=settings.STRIPE_PUBLISHABLE_KEY
# Create your views here.

def testing(request):
    return render(request,"login.html",{'key':STRIPE_PUBLISHABLE_KEY1})

def charge(request): # new
    if request.method == 'POST':
        charge = stripe.Charge.create(
            amount=500,
            currency='usd',
            description='A Django charge',
            source=request.POST['stripeToken']
        )
        return render(request, 'success.html')

Всегда отображается ошибка NameError в / charge / name 'stripe' не определено

...