Server error during upload(500)

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

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


Do you get any errors? If yes, is it from Nginx or Gunicorn? Show the last lines from the log. What’s the output of this?

ls -l /home/kingiyk/stylplus/media/name-of-some-file-you-just-uploaded


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

--log-level debug

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.


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