I am fairly new to working with servers. I am attempting to run Django on an Ubuntu 12.04 AWS with uwsgi & nginx.

I found a tutorial that I was following: http://uwsgi.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

I created a virtual evn:

virtualenv uwsgi-tutorial
cd uwsgi-tutorial
source bin/activate

Then I installed Python & Django using pip. Then I started a Django project called mysite

Then I installed uwsgi

pip install uwsgi

Then I created a test.py file:

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return "Hello World"

Then I ran uwsgi:

uwsgi --http :8000 --wsgi-file test.py

The tutorial claims if I point my browser to my http://myip:8000 I should see Hello World in my browser. However, my browser sits waiting as if it is not connecting to the server at all.

When I run uwsgi --http :8000 --wsgi-file test.py I get this output in the terminal:

*** Starting uWSGI 2.0.1 (64bit) on [Tue Feb 25 15:26:43 2014] ***
compiled with version: 4.6.3 on 25 February 2014 05:36:40
os: Linux-3.2.0-59-virtual #90-Ubuntu SMP Tue Jan 7 23:02:33 UTC 2014
nodename: ip-172-31-13-105
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/spencer/uwsgi-tutorial/mysite
detected binary path: /home/spencer/uwsgi-tutorial/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 4592
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
spawned uWSGI http 1 (pid: 9729)
uwsgi socket 0 bound to TCP address (port auto-assigned) fd 3
Python version: 2.7.3 (default, Sep 26 2013, 20:13:52)  [GCC 4.6.3]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1bbc670
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72760 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1bbc670 pid: 9728 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 9728, cores: 1)

I may be missing something obvious or not completely understand but any help is greatly appreciated!

  • I never opened port 80... rookie mistake. I hope someone with the same problem with stumble across this and realize that they need to OPEN PORT 80 – skovy Feb 25 '14 at 16:30
  • You should post this as a self-answer rather than a comment. You should be eligible to do that now (it's an 8 hour wait if your rep is less than 100). serverfault.com/help/self-answer – Katherine Villyard Feb 27 '14 at 3:58

I never opened port 80... rookie mistake. I hope someone with the same problem will stumble across this and realize that they need to OPEN PORT 80

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.