Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internal Server Error with Django and uWSGI

Tags:

django

uwsgi

I am trying to follow the steps in this guide: http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Before I even get to the nginx part I am trying to make sure that uWSGI works correctly

my folder structure is srv/www/domain/projectdatabank/

the project databank folder contains my manage.py file

my wsgi.py file looks like this:

import os import sys from django.core.wsgi import get_wsgi_application application = get_wsgi_application() 

do you need to see my settings.py?

i get the following error when i point myself to the browser:

-- no python application found, check your startup logs for errors --- [pid: 10165|app: -1|req: -1/1] 66.56.35.151 () {38 vars in 681 bytes} [Tue Jul 9 18:19:46 2013] GET /admin/ => generated 21 bytes in 0 msecs (HTTP/1.1 500) 1 headers in 57 bytes (0 switches on core 0) --- no python application found, check your startup logs for errors --- [pid: 10165|app: -1|req: -1/2] 66.56.35.151 () {36 vars in 638 bytes} [Tue Jul 9 18:19:49 2013] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 1 headers in 57 bytes (0 switches on core 0)

Now when I check my uWGI log it is just the same as above.

like image 733
tareq Avatar asked Jul 09 '13 18:07

tareq


People also ask

What is uWSGI Django?

uWSGI is a fast, self-healing and developer/sysadmin-friendly application container server coded in pure C. See also. The uWSGI docs offer a tutorial covering Django, nginx, and uWSGI (one possible deployment setup of many). The docs below are focused on how to integrate Django with uWSGI.

What does uWSGI stand for?

uWSGI (source code), pronounced "mu wiz gee", is a Web Server Gateway Interface (WSGI) server implementation that is typically used to run Python web applications.

How do I disable uWSGI server?

Stopping the server If you have the uWSGI process running in the foreground for some reason, you can just hit CTRL+C to kill it off.


2 Answers

I have solved this

in my original command line did not include full path to the wsgi.py file to run uWSGI

uwsgi --http :8000 --chdir /srv/www/databankinfo.com/projectdatabank/ --wsgi-file wsgi.py 

to this

uwsgi --http :8000 --chdir /srv/www/databankinfo.com/projectdatabank/ --wsgi-file full/path/wsgi.py 

and it worked

like image 136
tareq Avatar answered Sep 28 '22 03:09

tareq


For others debugging this same error, there is another possibility: an exception is being thrown by your uwsgi.py. To test this, open a django shell in your app directly with python manage.py shell and import your uwsgi.py (use the same path as in your uwsgi.ini).

like image 35
Fraser Harris Avatar answered Sep 28 '22 05:09

Fraser Harris