简体   繁体   中英

Django and Gunicorn: 403 Forbidden

I have a django application inside /home//my_app that I am trying to deploy using gunicorn:

sudo gunicorn --workers=2 -b :8081 tutorial.wsgi:application

After deploying the application with the command above, I log into another ssh instance (on the same server) and run the following command:

wget 127.0.0.1:8081

This returns a 403 FORBIDDEN.

Things I have tried: 1. Tried to chmod 755, and even 777, in app directory (Did not work) 2. Tried to move app directory to /etc/www/myapp (Did not work) 3. Tried to run all commands using root access (Did not work)

It is worth noting that I am not that familiar with linux and that this error is literally driving me crazy.

SOLVED IT:
after downloading cURL, in order to see the http header, it turned out that the service worked, but returned a 403 because a missing token authorization. Oops.

请确保已将views.py和urls.py编码为/服务器GET重新请求。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM