0

I just started developing in Django a few days back. After finishing a few applications I read that Django is best served using nginx for static content and a reverse proxy to apache for dynamic contents. Is there a particular reason that this configuration preferred over any other?

Also, although this seems to be the standard approach I havent yet been able to find a proper tutorial or document that walks through such a configuration. Most seem to be incomplete/non-working.

It would be great if someone could explain to me how this is to be done or point in the right direction or maybe link a tutorial here.

Thanks in advance.

1 Answer 1

1

I suggest to use nginx and gunicorn/uwsgi configuration, it more common this days and easier to setup/configure that apache. A proper tutorials can be found here:

1) django + gunicorn and a more complete tutorial with supervisor, fabric here

2) django + uwsgi

Sign up to request clarification or add additional context in comments.

6 Comments

I tried the first link but it only shows the nginx welcome page. Also others seem non-ubuntu, will give it a shot anyway.
If it give you a welcome page that you didnt set a proxy-pass directive. location / { proxy_pass 127.0.0.1:8888; } if its set all request will be passed to gunicorn.
For ubuntu you can use this app that will do this configuration automatically pypi.python.org/pypi/django-fagungis
fagungis seems great but at the end of deployment it gives me an error statis project NOT STARTED(apparently supervisor is not able to start gunicorn) and my domain gives a bad gateway error. Is there anyway to resolve this?
Supervisor having issues spwaning the blog project. INFO spawned: 'blog' with pid 15772 INFO exited: blog (exit status 3; not expected) INFO gave up: blog entered FATAL state, too many start retries too quickly
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.