Server Error on deployment to Digitalocean server

122 views
Skip to first unread message

Azeez Akinsola

unread,
Aug 2, 2018, 8:29:51 AM8/2/18
to Django users
Hello everyone, 

  I need help to fix this problem. My application works perfectly on my localhost, but after deployment to a digital ocean server, I encounter server error 500 and 400. 
I attached the log error. Please, I need someone to help to fix this.
Screenshot (4).png
Screenshot (5).png
Screenshot (6).png

M Hashmi

unread,
Aug 2, 2018, 9:32:51 AM8/2/18
to django...@googlegroups.com
Set your SMTP configurations in settings.py. Make sure to follow wsgi handler properly by adding IP in ALLOWED_HOSTS = ['yourIP']. Make sure you've setup MX records for your domain configuration with DIgitalocean.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/21a8d436-43db-4d6f-8579-a906f5fe61ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Azeez Akinsola

unread,
Aug 2, 2018, 10:03:48 AM8/2/18
to Django users
Thank you Hashmi for your help. I am using sendgrid for sending emails

Please check my .env and settings.py files I deployed to the server, I am not sure if need to add or remove any variables

SEND_GRID_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
EMAIL_HOST_USER = 'xx...@gmail.com'
EMAIL_HOST_PASSWORD = 'xxxxxxxxxxx'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'xxx...@gmail.com'
ACCOUNT_EMAIL_SUBJECT_PREFIX = 'Registration Confirmation'
EMAIL_BACKEND = 'sgbackend.SendGridBackend'


settings.py

EMAIL_BACKEND = os.getenv("EMAIL_BACKEND")
SENDGRID_API_KEY = os.getenv("SEND_GRID_API_KEY")
DEFAULT_EMAIL_BCC=""
DEFAULT_EMAIL_FROM = os.getenv("DEFAULT_FROM_EMAIL")


On Thursday, August 2, 2018 at 2:32:51 PM UTC+1, M Hashmi wrote:
Set your SMTP configurations in settings.py. Make sure to follow wsgi handler properly by adding IP in ALLOWED_HOSTS = ['yourIP']. Make sure you've setup MX records for your domain configuration with DIgitalocean.
On Thu, Aug 2, 2018 at 4:42 AM, Azeez Akinsola <azizak...@gmail.com> wrote:
Hello everyone, 

  I need help to fix this problem. My application works perfectly on my localhost, but after deployment to a digital ocean server, I encounter server error 500 and 400. 
I attached the log error. Please, I need someone to help to fix this.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

M Hashmi

unread,
Aug 2, 2018, 10:10:56 AM8/2/18
to django...@googlegroups.com
You need to do little extra. Login to your DigitalOcean account and follow instructions in the link to add MX records for sendgrid. 



To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages