chribsen
chribsen

Reputation: 6620

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.

Upvotes: 0

Views: 716

Answers (1)

Vaibhav Mule
Vaibhav Mule

Reputation: 5136

Please make sure you have coded views.py and urls.py to server GET requeat at /.

Upvotes: 0

Related Questions