Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError #1051

Open
prosper-20 opened this issue Mar 20, 2022 · 3 comments
Open

ImportError #1051

prosper-20 opened this issue Mar 20, 2022 · 3 comments
Labels
status: waiting for feedback waiting for feedback from the submitter type: getting started question while getting started

Comments

@prosper-20
Copy link

Issue Summary

I'm currently trying to deploy my web application using Heroku. I have integrated Sendgrid[ A mail sending service] with my project, which worked perfectly in development but is displaying an import error on production.

Exception/Log

cannot import name 'SendGridAPIClient' from 'sendgrid'

  • sendgrid-python version: 3.6.5
  • python version: 3.9.11
  • sendgrid-django==4.2.0

I'm looking forward to a response.

@beebzz
Copy link

beebzz commented Mar 25, 2022

Hi @prosper-20! Could you please paste a code snippet in this thread so that we have better visibility into the issue?

@prosper-20
Copy link
Author

prosper-20 commented Mar 25, 2022

Good day. In response to your mail. I have attached two files to give further insight into the issue.
Screenshot (673)

from django.db import models
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.expressions import Ref
from django.shortcuts import redirect, reverse, render, get_object_or_404
from stripe.api_resources import order
from Order.models import Item, OrderItem, Order, Address, Payment, Coupon, Refund, UserProfile, ItemImage
from django.views.generic import ListView, DetailView
from django.utils import timezone
from django.views.generic import View
from .forms import CheckoutForm, CouponForm, RefundForm, PaymentForm
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
import stripe
from django.conf import settings
import random
import string 
from sendgrid import SendGridAPIClient # This is where the import error is occuring.
from django.contrib.auth.models import User

from django.template.loader import render_to_string
from django.core.mail import EmailMessage, send_mail
from sendgrid.helpers.mail import SandBoxMode, MailSettings

Thank you very much. Looking forward to your response.

@childish-sambino
Copy link
Contributor

sendgrid-python version: 3.6.5

This is a very old version of this library. Recommend upgrading to the latest release to help with troublshooting.

@childish-sambino childish-sambino added status: waiting for feedback waiting for feedback from the submitter type: getting started question while getting started labels Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for feedback waiting for feedback from the submitter type: getting started question while getting started
Projects
None yet
Development

No branches or pull requests

3 participants