_I am trying to send emails via sendgrid in django. But each time it says;_
sg = sendgrid.SendGridClient(settings.SENDGRID_USERNAME, settings.SENDGRID_PASSWORD, raise_errors=True)
AttributeError: 'module' object has no attribute 'SendGridClient'
However in requirements.txt file sendgrid ok and also import sendgrid.
and in setttings file it is properly configured.
Are you using virtualenv? Make sure you install it on your local environment. Also, you can take a look at this lib:
https://github.com/elbuo8/sendgrid-django
make sure you do not have any other file named as "sendgrid"
Could very well be it @changhaz. Thanks for the insight!
@elbuo8 i was using it without virtualenv, So i setup venv and problem is solved. thanks
Most helpful comment
make sure you do not have any other file named as "sendgrid"