zinking
zinking

Reputation: 5685

Did django use thread to handle requests?

what is the underlying infrastructure Django uses to handle its requests?

did it use thread, can someone give some reference on this ?

Upvotes: 2

Views: 1529

Answers (2)

Qi Fan
Qi Fan

Reputation: 827

If you get random segmentation faults when using manage.py runserver because some underlying C libraries you have to use in your project are not thread-safe, try manage.py runserver --nothreading instead.


For production services that run wsgi with tools like mod_wsgi, there is usually an option to disable threading. In this case WSGIDaemonProcess example processes=5 threads=1 See https://modwsgi.readthedocs.io/en/develop/user-guides/processes-and-threading.html

Upvotes: 1

jdi
jdi

Reputation: 92559

Django is not a web server. It is a web framework. The behavior of how it is being run as an application is dependant on your method for serving it.

It could be threaded requests. It could be processes. It could even be async.

Serving Files

Django doesn't serve files itself; it leaves that job to whichever Web server you choose.

Wsgi is the most common way to serve django right now, so really you should just investigate the configuration options of different wsgi implementations.

Upvotes: 4

Related Questions