3

Why is the Django webserver blocking, not non-blocking like Tornado? Was there a reason to design the webserver in this way?

sergzach
  • 6,578
  • 7
  • 46
  • 84
  • similar: [Blocking IO vs non-blocking IO; looking for good articles](http://stackoverflow.com/questions/1241429/blocking-io-vs-non-blocking-io-looking-for-good-articles) – Phil Frost Jan 04 '13 at 14:48

2 Answers2

5

I believe It is single threaded and blocking so it is easy to debug. if you put a debugger in it will completely halt the server

dm03514
  • 54,664
  • 18
  • 108
  • 145
5

If you really need another reason on top of that suggested by dm03514, it I'd probably simply because it was easier to write. Since the dev server I'd for development only, little effort was spent in making it more complex or able to serve multiple requests. In fact, this is an explicit goal: making it any better would encourage people to use it in a production setting, for which it is not tested.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
  • Do you mean that the core Django code is only for debugging and we must make it production using some extended services? – sergzach Jan 04 '13 at 14:55
  • 3
    It means that the built-in server is for local development/debugging only. The code you write for your Django app doesn't need any modifications to be "production" ready. It's just how it's served that changes from local to production. – Brandon Taylor Jan 04 '13 at 15:00