Ticket #3357: threading.2.patch

File threading.2.patch, 2.1 KB (added by Rob Hudson <treborhudson@…>, 8 years ago)

Same as last, but added "New in Development Version" to docs.

  • django/conf/global_settings.py

     
    113113EMAIL_HOST_USER = ''
    114114EMAIL_HOST_PASSWORD = ''
    115115
     116# Whether to use a multi-threaded development server.
     117USE_MULTITHREADED_SERVER = False
     118
    116119# List of strings representing installed apps.
    117120INSTALLED_APPS = ()
    118121
  • django/core/servers/basehttp.py

     
    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
    1112from types import ListType, StringType
    1213import os, re, sys, time, urllib
    1314
     15if settings.USE_MULTITHREADED_SERVER:
     16    # This creates a base HTTPServer class that supports multithreading
     17    import BaseHTTPServer, SocketServer
     18    class HTTPServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):
     19        def __init__(self, server_address, RequestHandlerClass=None):
     20            BaseHTTPServer.HTTPServer.__init__(self, server_address, RequestHandlerClass)
     21else:
     22    from BaseHTTPServer import HTTPServer
     23
    1424__version__ = "0.1"
    1525__all__ = ['WSGIServer','WSGIRequestHandler','demo_app']
    1626
  • docs/settings.txt

     
    856856set to ``False``, Django will make some optimizations so as not to load the
    857857internationalization machinery.
    858858
     859USE_MULTITHREADED_SERVER
     860------------------------
     861
     862**New in Django development version**
     863
     864Default: ``False``
     865
     866A boolean that specifies whether Django's built-in development server
     867should run multi-threaded.  Caution should be taken when setting this to
     868True so as to avoid multi-threading bugs in your views.
     869
    859870YEAR_MONTH_FORMAT
    860871-----------------
    861872
Back to Top