Report this

What is the reason for this report?

Server error during upload(500)

Posted on July 23, 2017

Hello fellow humans.

I finally deployed my app after following the tutorial how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04 but when i try to upload a file on the site as a user, i get server error (500). Wht do I have to do to remedy the problem as soon as possible??

will appreciate your assistance



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!

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.

Hi @iknwosu3

Can you show the log both Gunicorn and Nginx?

tail -20 /var/log/nginx/error.log
tail -20 /path/to/gunicorn.log

@iknwosu3

Change it do this:

ExecStart=/home/kingiyk/stylplus/env/bin/gunicorn --error-logfile /var/log/gunicorn.log --access-logfile - --workers 3  --bind unix:/home/kingiyk/stylplus/stylplus.sock stylplus.wsgi:application

Restart Gunicorn sudo service gunicorn restart Try to upload, so you get the error and then check /var/log/gunicorn.log

@iknwosu3

Okay, change current log level to debug, by adding this parameter:

--log-level debug

http://docs.gunicorn.org/en/stable/settings.html#loglevel

There’s something wrong with your upload-code or maybe you try save the uploaded file to a place where there’s no permissions, which somehow is crashing Gunicorn.

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.