Code

Ticket #3357: threading.3.patch

File threading.3.patch, 2.0 KB (added by Camille Harang, 6 years ago)

Updated for 7409

  • ./django/conf/global_settings.py

    old new  
    133133EMAIL_HOST_PASSWORD = '' 
    134134EMAIL_USE_TLS = False 
    135135 
     136# Whether to use a multi-threaded development server. 
     137USE_MULTITHREADED_SERVER = False  
     138 
    136139# List of strings representing installed apps. 
    137140INSTALLED_APPS = () 
    138141 
  • ./django/core/servers/basehttp.py

    old new  
    77been reviewed for security issues. Don't use it for production use. 
    88""" 
    99 
    10 from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer 
     10from django.conf import settings  
     11from BaseHTTPServer import BaseHTTPRequestHandler 
    1112import mimetypes 
    1213import os 
    1314import re 
     
    1617 
    1718from django.utils.http import http_date 
    1819 
     20if settings.USE_MULTITHREADED_SERVER:  
     21    # This creates a base HTTPServer class that supports multithreading  
     22    import BaseHTTPServer, SocketServer  
     23    class HTTPServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):  
     24        def __init__(self, server_address, RequestHandlerClass=None):  
     25            BaseHTTPServer.HTTPServer.__init__(self, server_address, RequestHandlerClass)  
     26else:  
     27    from BaseHTTPServer import HTTPServer  
     28 
    1929__version__ = "0.1" 
    2030__all__ = ['WSGIServer','WSGIRequestHandler','demo_app'] 
    2131 
  • ./docs/settings.txt

    old new  
    11171117set to ``False``, Django will make some optimizations so as not to load the 
    11181118internationalization machinery. 
    11191119 
     1120USE_MULTITHREADED_SERVER  
     1121------------------------  
     1122  
     1123**New in Django development version**  
     1124  
     1125Default: ``False``  
     1126  
     1127A boolean that specifies whether Django's built-in development server  
     1128should run multi-threaded.  Caution should be taken when setting this to  
     1129True so as to avoid multi-threading bugs in your views. 
     1130 
    11201131YEAR_MONTH_FORMAT 
    11211132----------------- 
    11221133