开发者

Django web server -- where should I draw the line between production and development?

开发者 https://www.devze.com 2023-03-02 21:03 出处:网络
I know that it\'s bad to use the Django web server in production. There\'s been at开发者_Python百科 least one Stackoveflow question on this already.

I know that it's bad to use the Django web server in production. There's been at开发者_Python百科 least one Stackoveflow question on this already.

But I'm wondering about where to draw the line between development and production? If I'm only allowing HTTP access to one (or a few) IP addresses, then I know I'm in development. What if I open it to all IP addresses, but only e-mail a couple friends to see what they think of what I've built?

As far as I can tell, the problems with using the Django server are:

  1. It's single-threaded
  2. Security

I don't think (1) is likely to be an issue if I'm only sharing it with a few people. For (2)--what's the worst-case scenario? Does it make a difference that I'm running on an Amazon EC2 server that I could very easily restart from a backup if something bad happened?


Well, the answer is very simple actually, you've left development when you have something you must protect: real user personal information, real data in your database that you'd be afraid to lose, etc.

Security isn't a concern until these things are present. The rule about not using the dev server in "production" is guidance, not mandatory. You can fire up the dev server in your production environment any time you want. However, you'd be silly to do so and then open up universal access to it, once your site is truly live and in use by the world.


Setting up mod_wsgi (or some other WSGI container) on a development machine takes all of 5 minutes, and can help you sort out deployment issues before you actually reach deployment. So really, why ever use the development server if you don't have to?

0

精彩评论

暂无评论...
验证码 换一张
取 消