Django

Code

Show
Ignore:
Timestamp:
08/05/08 12:15:33 (5 months ago)
Author:
jbronn
Message:

gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis

    • Property svnmerge-integrated changed from /django/trunk:1-7978 to /django/trunk:1-8214
  • django/branches/gis/docs/fastcgi.txt

    r7354 r8215  
    8080list of all the available options. 
    8181 
    82 You'll need to specify either a ``socket``, ``protocol`` or both ``host`` and ``port``. 
    83 Then, when you set up your Web server, you'll just need to point it at the host/por
    84 or socket you specified when starting the FastCGI server. 
     82You'll need to specify either a ``socket``, ``protocol`` or both ``host`` and 
     83``port``. Then, when you set up your Web server, you'll just need to point i
     84at the host/port or socket you specified when starting the FastCGI server. 
    8585 
    8686Protocols 
     
    209209 
    210210.. _mod_rewrite: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html 
     211 
     212Django will automatically use the pre-rewrite version of the URL when 
     213constructing URLs with the ``{% url %}`` template tag (and similar methods). 
    211214 
    212215lighttpd setup 
     
    337340.. _modpython: ../modpython/#serving-the-admin-files 
    338341 
     342Forcing the URL prefix to a particular value 
     343============================================ 
     344 
     345Because many of these fastcgi-based solutions require rewriting the URL at 
     346some point inside the webserver, the path information that Django sees may not 
     347resemble the original URL that was passed in. This is a problem if the Django 
     348application is being served from under a particular prefix and you want your 
     349URLs from the ``{% url %}`` tag to look like the prefix, rather than the 
     350rewritten version, which might contain, for example, ``mysite.fcgi``. 
     351 
     352Django makes a good attempt to work out what the real script name prefix 
     353should be. In particular, if the webserver sets the ``SCRIPT_URL`` (specific 
     354to Apache's mod_rewrite), or ``REDIRECT_URL`` (set by a few servers, including 
     355Apache + mod_rewrite in some situations), Django will work out the original 
     356prefix automatically. 
     357 
     358In the cases where Django cannot work out the prefix correctly and where you 
     359want the original value to be used in URLs, you can set the 
     360``FORCE_SCRIPT_NAME`` setting in your main ``settings`` file. This sets the 
     361script name uniformly for every URL served via that settings file. Thus you'll 
     362need to use different settings files if you want different sets of URLs to 
     363have different script names in this case, but that is a rare situation. 
     364 
     365As an example of how to use it, if your Django configuration is serving all of 
     366the URLs under ``'/'`` and you wanted to use this setting, you would set 
     367``FORCE_SCRIPT_NAME = ''`` in your settings file. 
     368