Ticket #16360: 16360.3.diff
File 16360.3.diff, 51.9 KB (added by , 13 years ago) |
---|
-
django/conf/global_settings.py
diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py index 29c9812..18a9d38 100644
a b X_FRAME_OPTIONS = 'SAMEORIGIN' 404 404 405 405 USE_X_FORWARDED_HOST = False 406 406 407 # The import name of the WSGI application. If this is `None` the default 408 # 'django.core.handlers.wsgi.application' is used. Otherwise this shall 409 # point to an actual WSGI application. 410 WSGI_APPLICATION = None 411 407 412 ############## 408 413 # MIDDLEWARE # 409 414 ############## -
django/conf/project_template/settings.py
diff --git a/django/conf/project_template/settings.py b/django/conf/project_template/settings.py index b92c116..9eb91f7 100644
a b MIDDLEWARE_CLASSES = ( 99 99 100 100 ROOT_URLCONF = '{{ project_name }}.urls' 101 101 102 # The WSGI application used by Django's runserver etc. 103 WSGI_APPLICATION = '{{ project_name }}.wsgi.application' 104 102 105 TEMPLATE_DIRS = ( 103 106 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". 104 107 # Always use forward slashes, even on Windows. -
new file django/conf/project_template/wsgi.py
diff --git a/django/conf/project_template/wsgi.py b/django/conf/project_template/wsgi.py new file mode 100644 index 0000000..7e37f60
- + 1 """ 2 WSGI config for {{ project_name }} project. 3 4 This module contains the actual WSGI application to be used by Django's 5 development server and the production environment as the global variable 6 named ``application`` and is enabled by setting the ``WSGI_APPLICATION`` 7 setting to '{{ project_name }}.wsgi.application'. 8 9 Of course usually you would have an actual Django WSGI application here, 10 but it also might make sense to replace the whole Django WSGI application 11 with a custom one that later delegates to the Django one (for instance if 12 you want to combine a Django application with an application of another 13 framework). 14 """ 15 from django.core.management import setup_settings 16 17 settings = setup_settings(__name__) 18 19 # The application object is used by the development server 20 # as well as a WSGI server configured to use this file. 21 from django.core.handlers.wsgi import application 22 23 # Apply other WSGI middlewares here. 24 # from helloworld.wsgi import HelloWorldApplication 25 # application = HelloWorldApplication(application) -
django/contrib/staticfiles/handlers.py
diff --git a/django/contrib/staticfiles/handlers.py b/django/contrib/staticfiles/handlers.py index 962b835..d9f6833 100644
a b class StaticFilesHandler(WSGIHandler): 12 12 WSGI middleware that intercepts calls to the static files directory, as 13 13 defined by the STATIC_URL setting, and serves those files. 14 14 """ 15 def __init__(self, application, base_dir=None): 15 def __init__(self, application, base_dir=None, enabled=True): 16 # If not enabled this directly proxies to the given application. 17 self.enabled = enabled 16 18 self.application = application 17 19 if base_dir: 18 20 self.base_dir = base_dir … … class StaticFilesHandler(WSGIHandler): 63 65 return super(StaticFilesHandler, self).get_response(request) 64 66 65 67 def __call__(self, environ, start_response): 66 if notself._should_handle(environ['PATH_INFO']):67 return s elf.application(environ, start_response)68 return s uper(StaticFilesHandler, self).__call__(environ, start_response)68 if self.enabled and self._should_handle(environ['PATH_INFO']): 69 return super(StaticFilesHandler, self).__call__(environ, start_response) 70 return self.application(environ, start_response) -
django/contrib/staticfiles/management/commands/runserver.py
diff --git a/django/contrib/staticfiles/management/commands/runserver.py b/django/contrib/staticfiles/management/commands/runserver.py index c6e56d2..d4e332c 100644
a b class Command(BaseRunserverCommand): 21 21 handler = super(Command, self).get_handler(*args, **options) 22 22 use_static_handler = options.get('use_static_handler', True) 23 23 insecure_serving = options.get('insecure_serving', False) 24 if (settings.DEBUG and use_static_handler or 25 (use_static_handler and insecure_serving)): 26 handler = StaticFilesHandler(handler) 27 return handler 24 enabled = use_static_handler and (settings.DEBUG or insecure_serving) 25 return StaticFilesHandler(handler, enabled=enabled) -
django/core/handlers/base.py
diff --git a/django/core/handlers/base.py b/django/core/handlers/base.py index b7c0ff8..3606e18 100644
a b def get_script_name(environ): 242 242 Returns the equivalent of the HTTP request's SCRIPT_NAME environment 243 243 variable. If Apache mod_rewrite has been used, returns what would have been 244 244 the script name prior to any rewriting (so it's the script name as seen 245 from the client's perspective), unless FORCE_SCRIPT_NAME is set (to246 anything).245 from the client's perspective), unless the FORCE_SCRIPT_NAME setting is 246 set (to anything). 247 247 """ 248 248 from django.conf import settings 249 249 if settings.FORCE_SCRIPT_NAME is not None: -
django/core/handlers/wsgi.py
diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py index a816cad..5d58102 100644
a b 1 from __future__ import with_statement 1 2 import sys 2 3 from threading import Lock 3 4 try: … … except ImportError: 7 8 8 9 from django import http 9 10 from django.core import signals 11 from django.core.exceptions import ImproperlyConfigured 10 12 from django.core.handlers import base 11 13 from django.core.urlresolvers import set_script_prefix 12 14 from django.utils import datastructures 13 15 from django.utils.encoding import force_unicode, iri_to_uri 16 from django.utils.importlib import import_module 14 17 from django.utils.log import getLogger 15 18 16 19 logger = getLogger('django.request') … … class LimitedStream(object): 124 127 self.buffer = sio.read() 125 128 return line 126 129 130 127 131 class WSGIRequest(http.HttpRequest): 128 132 def __init__(self, environ): 129 133 script_name = base.get_script_name(environ) … … class WSGIRequest(http.HttpRequest): 202 206 FILES = property(_get_files) 203 207 REQUEST = property(_get_request) 204 208 209 205 210 class WSGIHandler(base.BaseHandler): 206 211 initLock = Lock() 207 212 request_class = WSGIRequest 208 213 209 214 def __call__(self, environ, start_response): 210 from django.conf import settings211 212 215 # Set up middleware if needed. We couldn't do this earlier, because 213 216 # settings weren't available. 214 217 if self._request_middleware is None: … … class WSGIHandler(base.BaseHandler): 254 257 start_response(status, response_headers) 255 258 return response 256 259 260 application = WSGIHandler() 261 262 263 class DjangoWSGIApplication(object): 264 """ 265 Implements a proxy to the actual WSGI application as configured 266 by the user in settings.WSGI_APPLICATION which will usually be the 267 `application`, optionally with middlewares applied. 268 """ 269 def __init__(self): 270 self._instance = None 271 self._instance_lock = Lock() 272 273 def _load_application(self): 274 from django.conf import settings 275 app_path = getattr(settings, 'WSGI_APPLICATION') 276 if app_path is None: 277 return application 278 try: 279 module_name, attr = app_path.rsplit('.', 1) 280 return getattr(import_module(module_name), attr) 281 except (ImportError, AttributeError), e: 282 raise ImproperlyConfigured("WSGI application '%s' could not " 283 "be loaded: %s" % (app_path, e)) 284 285 def __call__(self, environ, start_response): 286 # Non-atomic check, avoids taking a lock at each call of this method 287 if self._instance is None: 288 with self._instance_lock: 289 # Atomic check, prevents concurrent initialization of self._instance 290 if self._instance is None: 291 self._instance = self._load_application() 292 return self._instance(environ, start_response) 293 294 # the proxy used in deployment 295 django_application = DjangoWSGIApplication() -
django/core/management/__init__.py
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py index ea494c7..9ee35d3 100644
a b def setup_environ(settings_mod, original_settings_path=None): 392 392 # way. For example, if this file (manage.py) lives in a directory 393 393 # "myproject", this code would add "/path/to/myproject" to sys.path. 394 394 if '__init__.py' in settings_mod.__file__: 395 p = os.path.dirname(settings_mod.__file__)395 path = os.path.dirname(settings_mod.__file__) 396 396 else: 397 p = settings_mod.__file__398 project_directory, settings_filename = os.path.split(p )397 path = settings_mod.__file__ 398 project_directory, settings_filename = os.path.split(path) 399 399 if project_directory == os.curdir or not project_directory: 400 400 project_directory = os.getcwd() 401 401 project_name = os.path.basename(project_directory) … … def setup_environ(settings_mod, original_settings_path=None): 425 425 426 426 return project_directory 427 427 428 429 def setup_settings(path): 430 """ 431 Configures the settings first by looking at the environment variable 432 DJANGO_SETTINGS_MODULE or if that fail tries to find it with the 433 given module path. 434 435 Example: 436 437 from django.core.management import setup_settings 438 439 setup_settings(__name__) 440 setup_settings('wsgi') 441 setup_settings('mysite.wsgi') 442 """ 443 try: 444 # Check if DJANGO_SETTINGS_MODULE is already given 445 settings_module = os.environ['DJANGO_SETTINGS_MODULE'] 446 if not settings_module: 447 raise KeyError 448 settings = import_module(settings_module) 449 except KeyError: 450 # Or try importing the settings module two levels up, 451 # so if name is 'mysite.wsgi', it'll try 'mysite.settings' 452 try: 453 settings = import_module('settings', path) 454 except ImportError: 455 # two levels up because name contains the submodule 456 settings = import_module('..settings', path) 457 setup_environ(settings) 458 459 # Return the settings module 460 from django.conf import settings 461 return settings 462 463 428 464 def execute_from_command_line(argv=None): 429 465 """ 430 466 A simple method that runs a ManagementUtility. -
django/core/management/commands/runserver.py
diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py index 2e693e7..c84bf30 100644
a b import sys 5 5 import socket 6 6 7 7 from django.core.management.base import BaseCommand, CommandError 8 from django.core.handlers.wsgi import WSGIHandler8 from django.core.handlers.wsgi import django_application 9 9 from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException 10 10 from django.utils import autoreload 11 11 … … class BaseRunserverCommand(BaseCommand): 37 37 """ 38 38 Returns the default WSGI handler for the runner. 39 39 """ 40 return WSGIHandler()40 return django_application 41 41 42 42 def handle(self, addrport='', *args, **options): 43 43 self.use_ipv6 = options.get('use_ipv6') -
django/core/servers/fastcgi.py
diff --git a/django/core/servers/fastcgi.py b/django/core/servers/fastcgi.py index 9f80d2b..442df44 100644
a b def runfastcgi(argset=[], **kwargs): 139 139 return False 140 140 141 141 # Prep up and go 142 from django.core.handlers.wsgi import WSGIHandler142 from django.core.handlers.wsgi import django_application 143 143 144 144 if options["host"] and options["port"] and not options["socket"]: 145 145 wsgi_opts['bindAddress'] = (options["host"], int(options["port"])) … … def runfastcgi(argset=[], **kwargs): 178 178 fp.write("%d\n" % os.getpid()) 179 179 fp.close() 180 180 181 WSGIServer( WSGIHandler(), **wsgi_opts).run()181 WSGIServer(django_application, **wsgi_opts).run() 182 182 183 183 if __name__ == '__main__': 184 184 runfastcgi(sys.argv[1:]) -
docs/howto/deployment/fastcgi.txt
diff --git a/docs/howto/deployment/fastcgi.txt b/docs/howto/deployment/fastcgi.txt index 1f769cb..b4a0c4f 100644
a b How to use Django with FastCGI, SCGI, or AJP 5 5 .. highlight:: bash 6 6 7 7 Although the current preferred setup for running Django is :doc:`Apache with 8 mod_wsgi </howto/deployment/ modwsgi>`, many people use shared hosting, on8 mod_wsgi </howto/deployment/wsgi/modwsgi>`, many people use shared hosting, on 9 9 which protocols such as FastCGI, SCGI or AJP are the only viable options. In 10 10 some setups, these protocols may provide better performance than mod_wsgi_. 11 11 -
docs/howto/deployment/index.txt
diff --git a/docs/howto/deployment/index.txt b/docs/howto/deployment/index.txt index fdfce3e..113f606 100644
a b ways to easily deploy Django: 9 9 .. toctree:: 10 10 :maxdepth: 1 11 11 12 modwsgi 13 uwsgi 12 wsgi/index 14 13 fastcgi 15 14 mod_python (deprecated) <modpython> 16 15 17 16 If you're new to deploying Django and/or Python, we'd recommend you try 18 :doc:`mod_wsgi </howto/deployment/ modwsgi>` first. In most cases it'll be17 :doc:`mod_wsgi </howto/deployment/wsgi/modwsgi>` first. In most cases it'll be 19 18 the easiest, fastest, and most stable deployment choice. 20 19 21 20 .. seealso:: -
docs/howto/deployment/modpython.txt
diff --git a/docs/howto/deployment/modpython.txt b/docs/howto/deployment/modpython.txt index f5030e9..0d9edd3 100644
a b How to use Django with Apache and mod_python 7 7 Support for mod_python has been deprecated, and will be removed in 8 8 Django 1.5. If you are configuring a new deployment, you are 9 9 strongly encouraged to consider using :doc:`mod_wsgi 10 </howto/deployment/ modwsgi>` or any of the other :doc:`supported10 </howto/deployment/wsgi/modwsgi>` or any of the other :doc:`supported 11 11 backends </howto/deployment/index>`. 12 12 13 13 .. highlight:: apache 14 14 15 15 The `mod_python`_ module for Apache_ can be used to deploy Django to a 16 16 production server, although it has been mostly superseded by the simpler 17 :doc:`mod_wsgi deployment option </howto/deployment/ modwsgi>`.17 :doc:`mod_wsgi deployment option </howto/deployment/wsgi/modwsgi>`. 18 18 19 19 mod_python is similar to (and inspired by) `mod_perl`_ : It embeds Python within 20 20 Apache and loads Python code into memory when the server starts. Code stays in -
deleted file docs/howto/deployment/modwsgi.txt
diff --git a/docs/howto/deployment/modwsgi.txt b/docs/howto/deployment/modwsgi.txt deleted file mode 100644 index d268334..0000000
+ - 1 ==========================================2 How to use Django with Apache and mod_wsgi3 ==========================================4 5 Deploying Django with Apache_ and `mod_wsgi`_ is the recommended way to get6 Django into production.7 8 .. _Apache: http://httpd.apache.org/9 .. _mod_wsgi: http://code.google.com/p/modwsgi/10 11 mod_wsgi is an Apache module which can be used to host any Python application12 which supports the Python WSGI interface described in :pep:`3333`, including13 Django. Django will work with any version of Apache which supports mod_wsgi.14 15 The `official mod_wsgi documentation`_ is fantastic; it's your source for all16 the details about how to use mod_wsgi. You'll probably want to start with the17 `installation and configuration documentation`_.18 19 .. _official mod_wsgi documentation: http://code.google.com/p/modwsgi/20 .. _installation and configuration documentation: http://code.google.com/p/modwsgi/wiki/InstallationInstructions21 22 Basic configuration23 ===================24 25 Once you've got mod_wsgi installed and activated, edit your ``httpd.conf`` file26 and add::27 28 WSGIScriptAlias / /path/to/mysite/apache/django.wsgi29 30 The first bit above is the url you want to be serving your application at (``/``31 indicates the root url), and the second is the location of a "WSGI file" -- see32 below -- on your system, usually inside of your project. This tells Apache33 to serve any request below the given URL using the WSGI application defined by that file.34 35 Next we'll need to actually create this WSGI application, so create the file36 mentioned in the second part of ``WSGIScriptAlias`` and add::37 38 import os39 import sys40 41 os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'42 43 import django.core.handlers.wsgi44 application = django.core.handlers.wsgi.WSGIHandler()45 46 If your project is not on your ``PYTHONPATH`` by default you can add::47 48 path = '/path/to/mysite'49 if path not in sys.path:50 sys.path.append(path)51 52 just below the ``import sys`` line to place your project on the path. Remember to53 replace 'mysite.settings' with your correct settings file, and '/path/to/mysite'54 with your own project's location.55 56 .. _serving-files:57 58 Serving files59 =============60 61 Django doesn't serve files itself; it leaves that job to whichever Web62 server you choose.63 64 We recommend using a separate Web server -- i.e., one that's not also running65 Django -- for serving media. Here are some good choices:66 67 * lighttpd_68 * Nginx_69 * TUX_70 * A stripped-down version of Apache_71 * Cherokee_72 73 If, however, you have no option but to serve media files on the same Apache74 ``VirtualHost`` as Django, you can set up Apache to serve some URLs as75 static media, and others using the mod_wsgi interface to Django.76 77 This example sets up Django at the site root, but explicitly serves78 ``robots.txt``, ``favicon.ico``, any CSS file, and anything in the79 ``/static/`` and ``/media/`` URL space as a static file. All other URLs80 will be served using mod_wsgi::81 82 Alias /robots.txt /usr/local/wsgi/static/robots.txt83 Alias /favicon.ico /usr/local/wsgi/static/favicon.ico84 85 AliasMatch ^/([^/]*\.css) /usr/local/wsgi/static/styles/$186 87 Alias /media/ /usr/local/wsgi/media/88 Alias /static/ /usr/local/wsgi/static/89 90 <Directory /usr/local/wsgi/static>91 Order deny,allow92 Allow from all93 </Directory>94 95 <Directory /usr/local/wsgi/media>96 Order deny,allow97 Allow from all98 </Directory>99 100 WSGIScriptAlias / /usr/local/wsgi/scripts/django.wsgi101 102 <Directory /usr/local/wsgi/scripts>103 Order allow,deny104 Allow from all105 </Directory>106 107 .. _lighttpd: http://www.lighttpd.net/108 .. _Nginx: http://wiki.nginx.org/Main109 .. _TUX: http://en.wikipedia.org/wiki/TUX_web_server110 .. _Apache: http://httpd.apache.org/111 .. _Cherokee: http://www.cherokee-project.com/112 113 .. More details on configuring a mod_wsgi site to serve static files can be found114 .. in the mod_wsgi documentation on `hosting static files`_.115 116 .. _hosting static files: http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#Hosting_Of_Static_Files117 118 .. _serving-the-admin-files:119 120 Serving the admin files121 =======================122 123 Note that the Django development server automagically serves the static files124 of the admin app, but this is not the case when you use any other server125 arrangement. You're responsible for setting up Apache, or whichever media126 server you're using, to serve the admin files.127 128 The admin files live in (:file:`django/contrib/admin/static/admin`) of the129 Django distribution.130 131 We **strongly** recommend using :mod:`django.contrib.staticfiles` to handle132 the admin files, but here are two other approaches:133 134 1. Create a symbolic link to the admin static files from within your135 document root.136 137 2. Or, copy the admin static files so that they live within your Apache138 document root.139 140 Details141 =======142 143 For more details, see the `mod_wsgi documentation on Django integration`_,144 which explains the above in more detail, and walks through all the various145 options you've got when deploying under mod_wsgi.146 147 .. _mod_wsgi documentation on Django integration: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango -
deleted file docs/howto/deployment/uwsgi.txt
diff --git a/docs/howto/deployment/uwsgi.txt b/docs/howto/deployment/uwsgi.txt deleted file mode 100644 index 11cb51c..0000000
+ - 1 ============================2 How to use Django with uWSGI3 ============================4 5 .. highlight:: bash6 7 uWSGI_ is a fast, self-healing and developer/sysadmin-friendly application8 container server coded in pure C.9 10 It also provides a fast `caching framework`_ but its documentation is not the11 purpose of this document.12 13 .. _uWSGI: http://projects.unbit.it/uwsgi/14 .. _caching framework: http://projects.unbit.it/uwsgi/wiki/CachingFramework15 16 17 Prerequisite: uWSGI18 ===================19 20 The wiki describes several `installation procedures`_. Using pip, the python21 package manager, installing any uWSGI version can be done with one command22 line. For example::23 24 # install current stable version25 pip install uwsgi26 27 # or install LTS (long term support)28 pip install http://projects.unbit.it/downloads/uwsgi-lts.tar.gz29 30 .. _installation procedures: http://projects0.unbit.it/uwsgi/wiki/Install31 32 Prerequisite: general concept33 =============================34 35 uWSGI model36 -----------37 38 uWSGI operates on a client-server model. Your Web server (ie. nginx, Apache)39 communicates with a django-uwsgi "worker" process to serve dynamic contents.40 The Web server can communicate with the uWSGI process either:41 42 * directly by the uWSGI protocol through a socket created by uWSGI,43 * or by proxying HTTP requests to the minimalist HTTP server built in uWSGI.44 45 In the first case: the Web server can do uWSGI protocol (often with a46 module). It can then use either a Unix domain socket (a "named pipe" on Win3247 systems), or it can use a TCP socket. What you choose is a matterr of48 preference. Usually, a TCP socket is easier because connecting to a port49 doesn't require special permissions.50 51 In the second case, the Web server doesn't need to do uWSGI protocol. It just52 needs to be able to proxy HTTP requests to the HTTP server built-in uWSGI.53 The procedure is the same than proxying any HTTP server. Note that the Web54 server is a "reverse proxy" in this case.55 56 Configuring the uWSGI server57 ----------------------------58 59 In any case, when you set up your Web server, you'll just need to point its60 uwsgi or proxy module to the host/port or socket you specified when starting61 the uWSGI server.62 63 .. admonition:: Choosing the socket64 65 The easiest is to set the socket to a high level (>49152) local port like66 127.0.0.1:49152. If the socket is a file, the system administrator must67 ensure that the Web server process has read, write and execute privileges68 on that file.69 70 uWSGI is highly configurable and thus there are many ways to start the71 process. For example, uwsgi version 0.9.6.8 provides a hundred switches.72 This guide demonstrates the most important of them, but does not intent to73 substitute the official manual and online documentation.74 75 uWSGI supports configuration through:76 77 * environment variables78 * command line switches79 * ldap80 * ini files81 * xml files82 * yaml files83 84 Managing the uWSGI server85 -------------------------86 87 The system administrator controls the worker process pool by sending signals88 to the master process. For example, the unix kill command sends such signals.89 uWSGI can write the master process id to a "pidfile". A "pidfile" is a plain90 text file containing just a process id.91 92 Starting the server93 -------------------94 95 Starting an uWSGI server is the role of the system administrator, like96 starting the Web server. It is *not* the role of the Web server to start the97 uWSGI server. This means:98 99 * the uWSGI server can be restarted or reloaded independently from the Web100 server,101 * (except with Cheerokee), it is the role of the system administrator to make102 uWSGI to start on boot or reboot: either through tools like supervisor or103 daemontools, either directly at init level in a file like /etc/rc.local or104 /etc/conf.d/local105 106 Managing uWSGI107 ==============108 109 Starting the server110 -------------------111 112 Example command line for a Web server that understand the uWSGI protocol::113 114 uwsgi --chdir=/path/to/your/project115 --module='django.core.handlers.wsgi:WSGIHandler()' \116 --env DJANGO_SETTINGS_MODULE=settings \117 --master --pidfile=/tmp/project-master.pid \118 --socket=127.0.0.1:49152 \ # can also be a file119 --processes=5 \ # number of worker processes120 --uid=1000 --gid=2000 \ # if root, uwsgi can drop privileges121 --harakiri=20 \ # respawn processes taking more than 20 seconds122 --limit-as=128 \ # limit the project to 128 Megabytes123 --max-requests=5000 \ # respawn processes after serving 5000 requests124 --vacuum \ # clear environment on exit125 --home=/path/to/virtual/env \ # optionnal path to a virtualenv126 --daemonize=/var/log/uwsgi/yourproject.log # background the process127 128 Django specific options are:129 130 * ``chdir``: should be the path to your project131 * ``module``: uwsgi module to use132 * ``pythonpath``: optional path to your project virtualenv133 * ``env``: should contain at least ``DJANGO_SETTINGS_MODULE``134 135 Example ini configuration file::136 137 [uwsgi]138 chdir=/path/to/your/project139 master=True140 pidfile=/tmp/project-master.pid141 vacuum=True142 max-requests=5000143 deamonize=/var/log/uwsgi/yourproject.log144 145 Example ini configuration file usage::146 147 uwsgi --ini uwsgi.ini148 149 Read more `uWSGI configuration examples150 <http://projects.unbit.it/uwsgi/wiki/Example>`_.151 152 .. admonition:: Massive application hosting153 154 `uWSGI emperor <http://projects.unbit.it/uwsgi/wiki/Emperor>`_ is a special155 uWSGI process that can manage many master processes at once.156 157 Reloading the daemon158 --------------------159 160 As mentioned above, the uWSGI master process is one of the core component of161 the uWSGI stack. The signal to brutally reload all the workers and the master162 process is SIGTERM. Example command to brutally reload the uWSGI processes::163 164 kill -TERM `cat /tmp/project-master.pid`165 166 Patching the daemon167 -------------------168 169 One of the great advantages of uWSGI is its ability to gradually restart each170 worker without loosing any request.171 172 For example, uWSGI can be signaled that worker should reload the code after173 handling their current request (if any) from bash::174 175 # using kill to send the signal176 kill -HUP `cat /tmp/project-master.pid`177 178 # if uwsgi was started with --touch-reload=/tmp/somefile179 touch /tmp/somefile180 181 Or from Python::182 183 uwsgi.reload()184 185 Stopping the daemon186 -------------------187 188 If you have the process running in the foreground, it's easy enough to stop it:189 Simply hitting ``Ctrl-C`` will stop and quit the uWSGI server. However, when190 you're dealing with background processes, you'll need to resort to the Unix191 ``kill`` command.192 193 The ``kill`` is used to send a signal to the uWSGI master process. The194 `uWSGI signals are documented online195 <http://projects.unbit.it/uwsgi/wiki/uWSGISignals>`_. Example command to196 completely stop the uWSGI stack::197 198 kill -INT `cat /tmp/project-master.pid`199 200 HTTP server configuration201 =========================202 203 Nginx setup204 -----------205 206 Nginx provides the `uwsgi module <http://wiki.nginx.org/HttpUwsgiModule>`_ by207 default since nginx 0.8.40. Configuring Nginx to use an uWSGI server is as208 simple as setting it up to proxy requests::209 210 location / {211 uwsgi_pass 127.0.0.1:49152;212 # in case of a socket file:213 # uwsgi_pass unix:/tmp/yourproject.sock;214 }215 216 Note that default uwsgi parameters should be included somewhere in your Nginx217 configuration. For example::218 219 http {220 include uwsgi_params;221 # [...] normal nginx configuration here222 }223 224 Cherokee setup225 --------------226 227 Cherokee setup is documented in the `official Cherokee uWSGI documentation228 <http://www.cherokee-project.com/doc/cookbook_uwsgi.html>`_.229 230 Lighttpd setup231 --------------232 233 `Lighttpd uwsgi module <http://projects.unbit.it/uwsgi/wiki/RunOnLighttpd>`_ is234 still experimental.235 236 Troubleshooting237 ===============238 239 As usual, the first things to do is to check the logs. This implies:240 241 * the web server log, which will indicate if it couldn't connect to the uWSGI242 process,243 * the uWSGI log, which will indicate if an exception was thrown.244 245 Typical gotchas:246 247 * If the socket is a file, the Web server process should have read, write and248 execute permissions on the socket file. The ``--chmod-socket`` option can do249 it.250 * In some cases, for instance if uWSGI was started without ``--vacuum`` or251 killed with ``SIGKILL``, it won't remove the socket and pidfile when it is252 interrupted. It is safe to remove them manually and to start uWSGI again in253 that case.254 * uWSGI can start the process on the foreground, this will make errors easily255 visible to the system administrator. -
new file docs/howto/deployment/wsgi/index.txt
diff --git a/docs/howto/deployment/wsgi/index.txt b/docs/howto/deployment/wsgi/index.txt new file mode 100644 index 0000000..a838cf6
- + 1 =============== 2 How to use WSGI 3 =============== 4 5 Django's prefered platform of deployment is WSGI -- the "Web Server Gateway 6 Interface" standard as defined in :pep:`333` for web servers and application 7 servers that communicate with web applications. 8 9 Specifically, you can configure how WSGI is used by Django internally (e.g. 10 by the :djadmin:`runserver` management command) and externally when deploying 11 to one of the more commonly known platforms: 12 13 .. toctree:: 14 :maxdepth: 1 15 16 modwsgi 17 uwsgi 18 19 The ``application`` object 20 -------------------------- 21 22 One key concept of deploying with WSGI is to specify a central ``application`` 23 object which the webserver uses to communicate with your code. That's why 24 it's commonly specified as an object called ``application`` in a Python 25 module usable by the server. 26 27 Django ships such a WSGI application object in the 28 ``django.core.handlers.wsgi`` module by default but offers further 29 configurability with the :setting:`WSGI_APPLICATION` setting. 30 31 The ``WSGI_APPLICATION`` setting 32 -------------------------------- 33 34 The :setting:`WSGI_APPLICATION` setting should point to a WSGI compatible 35 application object, specified as a dotted Python import path. By default the 36 :djadmin:`startproject` command creates a file called ``wsgi.py`` in the 37 project directory and automatically sets :setting:`WSGI_APPLICATION` to 38 ``<PROJECT_NAME>.wsgi``. Django will internally automatically use this 39 module's application object when serving pages with the 40 :djadmin:`development server <runserver>`. 41 42 For example the file generated by :djadmin:`startproject` contains:: 43 44 from django.core.management import setup_settings 45 46 settings = setup_settings(__name__) 47 48 # The application object is used by the development server 49 # as well as a WSGI server configured to use this file. 50 from django.core.handlers.wsgi import application 51 52 The call to ``setup_settings`` is required to make sure the settings are 53 configured correctly before importing the WSGI handler. 54 55 To apply `WSGI middlewares`_ you can simple wrap the application object 56 in the same file:: 57 58 from helloworld.wsgi import HelloWorldApplication 59 application = HelloWorldApplication(application) 60 61 Of course usually you would have an actual Django WSGI application here, 62 but it also might make sense to replace the whole Django WSGI application 63 with a custom WSGI application that later delegates to the Django WSGI 64 application (for instance if you want to combine a Django application with 65 a WSGI application of another framework). 66 67 In case the :setting:`WSGI_APPLICATION` setting is ``None`` Django will 68 automatically use the ``django.core.handlers.wsgi.application`` object. 69 70 .. _`WSGI middlewares`: http://www.python.org/dev/peps/pep-0333/#middleware-components-that-play-both-sides -
new file docs/howto/deployment/wsgi/modwsgi.txt
diff --git a/docs/howto/deployment/wsgi/modwsgi.txt b/docs/howto/deployment/wsgi/modwsgi.txt new file mode 100644 index 0000000..af286f7
- + 1 ========================================== 2 How to use Django with Apache and mod_wsgi 3 ========================================== 4 5 Deploying Django with Apache_ and `mod_wsgi`_ is the recommended way to get 6 Django into production. 7 8 .. _Apache: http://httpd.apache.org/ 9 .. _mod_wsgi: http://code.google.com/p/modwsgi/ 10 11 mod_wsgi is an Apache module which can be used to host any Python application 12 which supports the Python WSGI interface described in :pep:`333`, including 13 Django. Django will work with any version of Apache which supports mod_wsgi. 14 15 The `official mod_wsgi documentation`_ is fantastic; it's your source for all 16 the details about how to use mod_wsgi. You'll probably want to start with the 17 `installation and configuration documentation`_. 18 19 .. _official mod_wsgi documentation: http://code.google.com/p/modwsgi/ 20 .. _installation and configuration documentation: http://code.google.com/p/modwsgi/wiki/InstallationInstructions 21 22 Basic configuration 23 =================== 24 25 Once you've got mod_wsgi installed and activated, edit your ``httpd.conf`` 26 file and add:: 27 28 WSGIScriptAlias / /path/to/mysite/wsgi.py 29 30 The first bit above is the url you want to be serving your application at 31 (``/`` indicates the root url), and the second is the location of a "WSGI 32 file" -- see below -- on your system, usually inside of your project. This 33 tells Apache to serve any request below the given URL using the WSGI 34 application defined by that file. 35 36 Next we'll need to actually create this WSGI application, so create the file 37 mentioned in the second part of ``WSGIScriptAlias`` and add:: 38 39 import sys 40 from django.core.management import setup_settings 41 42 setup_settings(__name__) 43 44 # The application object is used by the development server 45 # as well as a WSGI server configured to use this file. 46 from django.core.handlers.wsgi import application 47 48 If your project is not on your ``PYTHONPATH`` by default you can add:: 49 50 path = '/path/to/mysite' 51 if path not in sys.path: 52 sys.path.append(path) 53 54 just below the ``import sys`` line to place your project on the path. 55 Remember to replace 'mysite.settings' with your correct settings file, 56 and ``'/path/to/mysite'`` with your own project's location. 57 58 .. _serving-files: 59 60 Serving files 61 ============= 62 63 Django doesn't serve files itself; it leaves that job to whichever Web 64 server you choose. 65 66 We recommend using a separate Web server -- i.e., one that's not also running 67 Django -- for serving media. Here are some good choices: 68 69 * lighttpd_ 70 * Nginx_ 71 * TUX_ 72 * A stripped-down version of Apache_ 73 * Cherokee_ 74 75 If, however, you have no option but to serve media files on the same Apache 76 ``VirtualHost`` as Django, you can set up Apache to serve some URLs as 77 static media, and others using the mod_wsgi interface to Django. 78 79 This example sets up Django at the site root, but explicitly serves 80 ``robots.txt``, ``favicon.ico``, any CSS file, and anything in the 81 ``/static/`` and ``/media/`` URL space as a static file. All other URLs 82 will be served using mod_wsgi:: 83 84 Alias /robots.txt /usr/local/wsgi/static/robots.txt 85 Alias /favicon.ico /usr/local/wsgi/static/favicon.ico 86 87 AliasMatch ^/([^/]*\.css) /usr/local/wsgi/static/styles/$1 88 89 Alias /media/ /usr/local/wsgi/media/ 90 Alias /static/ /usr/local/wsgi/static/ 91 92 <Directory /usr/local/wsgi/static> 93 Order deny,allow 94 Allow from all 95 </Directory> 96 97 <Directory /usr/local/wsgi/media> 98 Order deny,allow 99 Allow from all 100 </Directory> 101 102 WSGIScriptAlias / /usr/local/wsgi/scripts/django.wsgi 103 104 <Directory /usr/local/wsgi/scripts> 105 Order allow,deny 106 Allow from all 107 </Directory> 108 109 .. _lighttpd: http://www.lighttpd.net/ 110 .. _Nginx: http://wiki.nginx.org/Main 111 .. _TUX: http://en.wikipedia.org/wiki/TUX_web_server 112 .. _Apache: http://httpd.apache.org/ 113 .. _Cherokee: http://www.cherokee-project.com/ 114 115 .. More details on configuring a mod_wsgi site to serve static files can be found 116 .. in the mod_wsgi documentation on `hosting static files`_. 117 118 .. _hosting static files: http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#Hosting_Of_Static_Files 119 120 .. _serving-the-admin-files: 121 122 Serving the admin files 123 ======================= 124 125 Note that the Django development server automagically serves the static files 126 of the admin app, but this is not the case when you use any other server 127 arrangement. You're responsible for setting up Apache, or whichever media 128 server you're using, to serve the admin files. 129 130 The admin files live in (:file:`django/contrib/admin/static/admin`) of the 131 Django distribution. 132 133 We **strongly** recommend using :mod:`django.contrib.staticfiles` to handle 134 the admin files, but here are two other approaches: 135 136 1. Create a symbolic link to the admin static files from within your 137 document root. 138 139 2. Or, copy the admin static files so that they live within your Apache 140 document root. 141 142 Details 143 ======= 144 145 For more details, see the `mod_wsgi documentation on Django integration`_, 146 which explains the above in more detail, and walks through all the various 147 options you've got when deploying under mod_wsgi. 148 149 .. _mod_wsgi documentation on Django integration: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango -
new file docs/howto/deployment/wsgi/uwsgi.txt
diff --git a/docs/howto/deployment/wsgi/uwsgi.txt b/docs/howto/deployment/wsgi/uwsgi.txt new file mode 100644 index 0000000..d3e631e
- + 1 ============================ 2 How to use Django with uWSGI 3 ============================ 4 5 .. highlight:: bash 6 7 uWSGI_ is a fast, self-healing and developer/sysadmin-friendly application 8 container server coded in pure C. 9 10 It also provides a fast `caching framework`_ but its documentation is not the 11 purpose of this document. 12 13 .. _uWSGI: http://projects.unbit.it/uwsgi/ 14 .. _caching framework: http://projects.unbit.it/uwsgi/wiki/CachingFramework 15 16 17 Prerequisite: uWSGI 18 =================== 19 20 The wiki describes several `installation procedures`_. Using pip, the python 21 package manager, installing any uWSGI version can be done with one command 22 line. For example:: 23 24 # install current stable version 25 pip install uwsgi 26 27 # or install LTS (long term support) 28 pip install http://projects.unbit.it/downloads/uwsgi-lts.tar.gz 29 30 .. _installation procedures: http://projects0.unbit.it/uwsgi/wiki/Install 31 32 Prerequisite: general concept 33 ============================= 34 35 uWSGI model 36 ----------- 37 38 uWSGI operates on a client-server model. Your Web server (ie. nginx, Apache) 39 communicates with a django-uwsgi "worker" process to serve dynamic contents. 40 The Web server can communicate with the uWSGI process either: 41 42 * directly by the uWSGI protocol through a socket created by uWSGI, 43 * or by proxying HTTP requests to the minimalist HTTP server built in uWSGI. 44 45 In the first case: the Web server can do uWSGI protocol (often with a 46 module). It can then use either a Unix domain socket (a "named pipe" on Win32 47 systems), or it can use a TCP socket. What you choose is a matterr of 48 preference. Usually, a TCP socket is easier because connecting to a port 49 doesn't require special permissions. 50 51 In the second case, the Web server doesn't need to do uWSGI protocol. It just 52 needs to be able to proxy HTTP requests to the HTTP server built-in uWSGI. 53 The procedure is the same than proxying any HTTP server. Note that the Web 54 server is a "reverse proxy" in this case. 55 56 Configuring the uWSGI server 57 ---------------------------- 58 59 In any case, when you set up your Web server, you'll just need to point its 60 uwsgi or proxy module to the host/port or socket you specified when starting 61 the uWSGI server. 62 63 .. admonition:: Choosing the socket 64 65 The easiest is to set the socket to a high level (>49152) local port like 66 127.0.0.1:49152. If the socket is a file, the system administrator must 67 ensure that the Web server process has read, write and execute privileges 68 on that file. 69 70 uWSGI is highly configurable and thus there are many ways to start the 71 process. For example, uwsgi version 0.9.6.8 provides a hundred switches. 72 This guide demonstrates the most important of them, but does not intent to 73 substitute the official manual and online documentation. 74 75 uWSGI supports configuration through: 76 77 * environment variables 78 * command line switches 79 * ldap 80 * ini files 81 * xml files 82 * yaml files 83 84 Managing the uWSGI server 85 ------------------------- 86 87 The system administrator controls the worker process pool by sending signals 88 to the master process. For example, the unix kill command sends such signals. 89 uWSGI can write the master process id to a "pidfile". A "pidfile" is a plain 90 text file containing just a process id. 91 92 Starting the server 93 ------------------- 94 95 Starting an uWSGI server is the role of the system administrator, like 96 starting the Web server. It is *not* the role of the Web server to start the 97 uWSGI server. This means: 98 99 * the uWSGI server can be restarted or reloaded independently from the Web 100 server, 101 * (except with Cheerokee), it is the role of the system administrator to make 102 uWSGI to start on boot or reboot: either through tools like supervisor or 103 daemontools, either directly at init level in a file like /etc/rc.local or 104 /etc/conf.d/local 105 106 Managing uWSGI 107 ============== 108 109 Starting the server 110 ------------------- 111 112 Example command line for a Web server that understand the uWSGI protocol:: 113 114 uwsgi --chdir=/path/to/your/project 115 --module='wsgi:application' \ 116 --env DJANGO_SETTINGS_MODULE=settings \ 117 --master --pidfile=/tmp/project-master.pid \ 118 --socket=127.0.0.1:49152 \ # can also be a file 119 --processes=5 \ # number of worker processes 120 --uid=1000 --gid=2000 \ # if root, uwsgi can drop privileges 121 --harakiri=20 \ # respawn processes taking more than 20 seconds 122 --limit-as=128 \ # limit the project to 128 Megabytes 123 --max-requests=5000 \ # respawn processes after serving 5000 requests 124 --vacuum \ # clear environment on exit 125 --home=/path/to/virtual/env \ # optionnal path to a virtualenv 126 --daemonize=/var/log/uwsgi/yourproject.log # background the process 127 128 Django specific options are: 129 130 * ``chdir``: should be the path to your project 131 * ``module``: WSGI module to use, probably the ``wsgi`` module which 132 :djadmin:`startproject` creates. 133 * ``pythonpath``: optional path to your project virtualenv 134 * ``env``: should contain at least ``DJANGO_SETTINGS_MODULE`` 135 136 Example ini configuration file:: 137 138 [uwsgi] 139 chdir=/path/to/your/project 140 master=True 141 pidfile=/tmp/project-master.pid 142 vacuum=True 143 max-requests=5000 144 deamonize=/var/log/uwsgi/yourproject.log 145 146 Example ini configuration file usage:: 147 148 uwsgi --ini uwsgi.ini 149 150 Read more `uWSGI configuration examples 151 <http://projects.unbit.it/uwsgi/wiki/Example>`_. 152 153 .. admonition:: Massive application hosting 154 155 `uWSGI emperor <http://projects.unbit.it/uwsgi/wiki/Emperor>`_ is a special 156 uWSGI process that can manage many master processes at once. 157 158 Reloading the daemon 159 -------------------- 160 161 As mentioned above, the uWSGI master process is one of the core component of 162 the uWSGI stack. The signal to brutally reload all the workers and the master 163 process is SIGTERM. Example command to brutally reload the uWSGI processes:: 164 165 kill -TERM `cat /tmp/project-master.pid` 166 167 Patching the daemon 168 ------------------- 169 170 One of the great advantages of uWSGI is its ability to gradually restart each 171 worker without loosing any request. 172 173 For example, uWSGI can be signaled that worker should reload the code after 174 handling their current request (if any) from bash:: 175 176 # using kill to send the signal 177 kill -HUP `cat /tmp/project-master.pid` 178 179 # if uwsgi was started with --touch-reload=/tmp/somefile 180 touch /tmp/somefile 181 182 Or from Python:: 183 184 uwsgi.reload() 185 186 Stopping the daemon 187 ------------------- 188 189 If you have the process running in the foreground, it's easy enough to stop it: 190 Simply hitting ``Ctrl-C`` will stop and quit the uWSGI server. However, when 191 you're dealing with background processes, you'll need to resort to the Unix 192 ``kill`` command. 193 194 The ``kill`` is used to send a signal to the uWSGI master process. The 195 `uWSGI signals are documented online 196 <http://projects.unbit.it/uwsgi/wiki/uWSGISignals>`_. Example command to 197 completely stop the uWSGI stack:: 198 199 kill -INT `cat /tmp/project-master.pid` 200 201 HTTP server configuration 202 ========================= 203 204 Nginx setup 205 ----------- 206 207 Nginx provides the `uwsgi module <http://wiki.nginx.org/HttpUwsgiModule>`_ by 208 default since nginx 0.8.40. Configuring Nginx to use an uWSGI server is as 209 simple as setting it up to proxy requests:: 210 211 location / { 212 uwsgi_pass 127.0.0.1:49152; 213 # in case of a socket file: 214 # uwsgi_pass unix:/tmp/yourproject.sock; 215 } 216 217 Note that default uwsgi parameters should be included somewhere in your Nginx 218 configuration. For example:: 219 220 http { 221 include uwsgi_params; 222 # [...] normal nginx configuration here 223 } 224 225 Cherokee setup 226 -------------- 227 228 Cherokee setup is documented in the `official Cherokee uWSGI documentation 229 <http://www.cherokee-project.com/doc/cookbook_uwsgi.html>`_. 230 231 Lighttpd setup 232 -------------- 233 234 `Lighttpd uwsgi module <http://projects.unbit.it/uwsgi/wiki/RunOnLighttpd>`_ is 235 still experimental. 236 237 Troubleshooting 238 =============== 239 240 As usual, the first things to do is to check the logs. This implies: 241 242 * the web server log, which will indicate if it couldn't connect to the uWSGI 243 process, 244 * the uWSGI log, which will indicate if an exception was thrown. 245 246 Typical gotchas: 247 248 * If the socket is a file, the Web server process should have read, write and 249 execute permissions on the socket file. The ``--chmod-socket`` option can do 250 it. 251 * In some cases, for instance if uWSGI was started without ``--vacuum`` or 252 killed with ``SIGKILL``, it won't remove the socket and pidfile when it is 253 interrupted. It is safe to remove them manually and to start uWSGI again in 254 that case. 255 * uWSGI can start the process on the foreground, this will make errors easily 256 visible to the system administrator. -
docs/index.txt
diff --git a/docs/index.txt b/docs/index.txt index 0425da4..f372bc6 100644
a b The development process 154 154 155 155 * **Deployment:** 156 156 :doc:`Overview <howto/deployment/index>` | 157 :doc:`Apache/mod_wsgi <howto/deployment/ modwsgi>` |158 :doc:`uWSGI <howto/deployment/ uwsgi>` |157 :doc:`Apache/mod_wsgi <howto/deployment/wsgi/modwsgi>` | 158 :doc:`uWSGI <howto/deployment/wsgi/uwsgi>` | 159 159 :doc:`Apache/mod_python (deprecated) <howto/deployment/modpython>` | 160 160 :doc:`FastCGI/SCGI/AJP <howto/deployment/fastcgi>` | 161 161 :doc:`Apache authentication <howto/apache-auth>` | -
docs/ref/contrib/gis/deployment.txt
diff --git a/docs/ref/contrib/gis/deployment.txt b/docs/ref/contrib/gis/deployment.txt index 14f803d..59003f2 100644
a b Example:: 54 54 number of ``processes`` instead. 55 55 56 56 For more information, please consult Django's 57 :doc:`mod_wsgi documentation </howto/deployment/ modwsgi>`.57 :doc:`mod_wsgi documentation </howto/deployment/wsgi/modwsgi>`. 58 58 59 59 ``mod_python`` 60 60 -------------- … … For more information, please consult Django's 62 62 .. warning:: 63 63 Support for mod_python will be deprecated in a future release of Django. If 64 64 you are configuring a new deployment, you are strongly encouraged to 65 consider using :doc:`mod_wsgi </howto/deployment/ modwsgi>` or any of the66 other :doc:`supported backends </howto/deployment/index>`.65 consider using :doc:`mod_wsgi </howto/deployment/wsgi/modwsgi>` or any of 66 the other :doc:`supported backends </howto/deployment/index>`. 67 67 68 68 Example:: 69 69 -
docs/ref/request-response.txt
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index e15fa50..7cbdaf4 100644
a b Methods 197 197 the ``HTTP_X_FORWARDED_HOST`` (if enabled in the settings) and ``HTTP_HOST`` 198 198 headers (in that order). If they don't provide a value, the method 199 199 uses a combination of ``SERVER_NAME`` and ``SERVER_PORT`` as 200 detailed in :pep:`333 3`.200 detailed in :pep:`333`. 201 201 202 202 Example: ``"127.0.0.1:8000"`` 203 203 -
docs/ref/settings.txt
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 8c7fe8f..b96fb96 100644
a b A boolean that specifies whether to use the X-Forwarded-Host header in 2095 2095 preference to the Host header. This should only be enabled if a proxy 2096 2096 which sets this header is in use. 2097 2097 2098 .. setting:: WSGI_APPLICATION 2099 2100 WSGI_APPLICATION 2101 ---------------- 2102 2103 .. versionadded:: 1.4 2104 2105 Default: ``None`` 2106 2107 The full Python path of the WSGI application object to use, as created 2108 by :djadmin:`django-admin.py startproject <startproject>`. 2109 2098 2110 .. setting:: YEAR_MONTH_FORMAT 2099 2111 2100 2112 YEAR_MONTH_FORMAT -
docs/releases/1.3-alpha-1.txt
diff --git a/docs/releases/1.3-alpha-1.txt b/docs/releases/1.3-alpha-1.txt index 3229cfd..7121271 100644
a b more flexible ``mod_wsgi`` backend. 303 303 304 304 If you are currently using the ``mod_python`` request handler, you are strongly 305 305 encouraged to redeploy your Django instances using :doc:`mod_wsgi 306 </howto/deployment/ modwsgi>`.306 </howto/deployment/wsgi/modwsgi>`. 307 307 308 308 Function-based generic views 309 309 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
docs/releases/1.3.txt
diff --git a/docs/releases/1.3.txt b/docs/releases/1.3.txt index 0130657..3a3c798 100644
a b more flexible ``mod_wsgi`` backend. 688 688 689 689 If you are currently using the ``mod_python`` request handler, you 690 690 should redeploy your Django projects using another request handler. 691 :doc:`mod_wsgi </howto/deployment/ modwsgi>` is the request handler691 :doc:`mod_wsgi </howto/deployment/wsgi/modwsgi>` is the request handler 692 692 recommended by the Django project, but :doc:`FastCGI 693 693 </howto/deployment/fastcgi>` is also supported. Support for 694 694 ``mod_python`` deployment will be removed in Django 1.5. -
docs/topics/install.txt
diff --git a/docs/topics/install.txt b/docs/topics/install.txt index 70b0783..5f3ad52 100644
a b documentation to determine which mode is right for your setup. Make 48 48 sure you have Apache installed, with the mod_wsgi module activated. 49 49 Django will work with any version of Apache that supports mod_wsgi. 50 50 51 See :doc:`How to use Django with mod_wsgi </howto/deployment/ modwsgi>`51 See :doc:`How to use Django with mod_wsgi </howto/deployment/wsgi/modwsgi>` 52 52 for information on how to configure mod_wsgi once you have it 53 53 installed. 54 54 … … If you can't use mod_wsgi for some reason, fear not: Django supports many other 56 56 deployment options. One is :doc:`uWSGI </howto/deployment/fastcgi>`; it works 57 57 very well with `nginx`_. Another is :doc:`FastCGI </howto/deployment/fastcgi>`, 58 58 perfect for using Django with servers other than Apache. Additionally, Django 59 follows the WSGI spec (:pep:`333 3`), which allows it to run on a variety of59 follows the WSGI spec (:pep:`333`), which allows it to run on a variety of 60 60 server platforms. See the `server-arrangements wiki page`_ for specific 61 61 installation instructions for each platform. 62 62 -
docs/topics/settings.txt
diff --git a/docs/topics/settings.txt b/docs/topics/settings.txt index 61ddf8c..507b092 100644
a b application what settings file to use. Do that with ``os.environ``:: 75 75 os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' 76 76 77 77 Read the :doc:`Django mod_wsgi documentation 78 </howto/deployment/ modwsgi>` for more information and other common78 </howto/deployment/wsgi/modwsgi>` for more information and other common 79 79 elements to a Django WSGI application. 80 80 81 81 Default settings