Grayson Swaim Grayson Swaim - 2 years ago 170
Python Question

Django (alternative to "runserver")

I'm trying to figure out how to deploy a django website without having to use a "run server" method on the command prompt. About 30 people in the company will utilize it internally, but documentation states that runserver is only for development purposes and not for production.

I've looked at MAMP, Apache, FastCGI, etc. I find myself questioning the amount of work it would require, and whether it would be recommended. My web is nothing fancy. A several files, links, Python scripts, etc.

I felt the other stack posts didn't do a great job phrasing their questions about basic "deployment methods" for django, which propagated a wide variety of answers.

So my question is specific: "what free, internal web server application is best recommended to handle a django framework facing a traffic of about 30 users without utilizing the runserver method on command prompt?"

Let me know how I can modify this question for better discussion.

Answer Source

WARNING: I know OP doesn't want to use runserver, I'm knowingly suggesting that he probably should because scaling is not an issue yet and there's no reason to introduce other dependencies for other reasons.

ANSWER Not using runserver is a choice that depends on scale. Everything said (including django documentation warning against using runserver on production), your situation really isn't production set up. Django's runserver is already pretty good and can usually handle the load you intend to, and if it can't it is unlikely that any other container can help you there (it is likely that your code is buggy).

What you need is to disallow hosts other than something specific: say the machine's hostname, or just the IP. You should set ALLOWED_HOSTS appropriately.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download