2

Do i need to use NginX or am i able to host it without it?

I am developing my first django project and am at the point where i can run the app project using the command:

./manage.py run_gunicorn -c config/gunicorn

I can then view it going to:

http://127.0.0.1:8000/resources/

I would now like to try hosting it so that other PCs can access this.

Calum
  • 2,110
  • 2
  • 22
  • 39
  • You do not ned NginX, most people use it to serve static files. Here is the example I used when setting up my blog http://senko.net/en/django-nginx-gunicorn/. – matt snider Feb 08 '13 at 02:13
  • @mattsnider I have seen that blog and it has been useful, but from my understanding it still uses NginX as a reverse proxy. Do i need that? – Calum Feb 08 '13 at 02:20

3 Answers3

2

Gunicorn is wsgi http server. It is best to use Gunicorn behind HTTP proxy server. We strongly advise you to use nginx.

@ http://gunicorn.org/#deployment

Although there are many HTTP proxies available, we strongly advise that you use Nginx. If you choose another proxy server you need to make sure that it buffers slow clients when you use default Gunicorn workers. Without this buffering Gunicorn will be easily susceptible to denial-of-service attacks.

@ http://docs.gunicorn.org/en/latest/deploy.html

VBart
  • 14,714
  • 4
  • 45
  • 49
0

Of course not. You can use lighttpd or any other web server that supports WSGI, SCGI, FastCGI or AJP. You may refer to this python documentation and django documentation, and these two questions on stackoverflow: Cleanest & Fastest server setup for Django, Differences and uses between WSGI, CGI, FastCGI, and mod_python in regards to Python? might be also helpful.

Community
  • 1
  • 1
Hui Zheng
  • 10,084
  • 2
  • 35
  • 40
0

You don't need a frontend proxy; you can put a standalone webserver like gunicorn directly in production. But there are various reasons why you probably want to use a frontend webserver anyway.

Community
  • 1
  • 1
hobbs
  • 223,387
  • 19
  • 210
  • 288