Question

Internal Server error when accessing the database

Hi,

I’m getting an Internal Server error when trying to log in to my Django app via the admin. I’ve noticed that I get the same error when trying to access my database in another way. Hopefully, you can help with the following:

  1. How can I get the log that’s causing this problem? At the moment, all I see in the runtime log is: booting worker with pid: 14
  2. Is it possible that I have a database setting wrong? To my knowledge, I’ve followed the deployment instructions carefully. Thank you in advance
Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I resolved the issue. I hadn’t specified the database_url :'), and I also got the test settings for the SMTP. Once I corrected both, the problems were resolved!

Bobby Iliev
Site Moderator
Site Moderator badge
December 13, 2023

Hi there,

In most cases, the 500 error is just a generic error, and in order to get the actual problem you would need to either check your logs or enable debugging.

Here are a few things that you could try:

  1. Accessing Detailed Logs:

    • To get more detailed logs, ensure that Django’s logging is set up correctly in your settings.py. You can configure it to log errors at a more verbose level, like DEBUG, during the troubleshooting phase.
    • Check your web server’s (like Gunicorn or Nginx) logs as well.
  2. Database Connection Issues:

    • Double-check your DATABASES setting, ensuring that all parameters like HOST, PORT, USER, PASSWORD, and NAME are correct.
    • If you’re using a managed database service, verify that your database instance is running and accessible from your Django application’s host.
  3. SMTP-Based Contact Form Issue:

    • Since the SMTP-based contact form stopped working, it’s possible that there’s an issue with your email backend configuration. Check your email backend settings in settings.py, especially the EMAIL_HOST, EMAIL_PORT, EMAIL_HOST_USER, EMAIL_HOST_PASSWORD, and EMAIL_USE_TLS or EMAIL_USE_SSL.

Feel free to share the actual error from the error logs so that I can try to advise you further!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.