Django

Code

Changeset 6536

Show
Ignore:
Timestamp:
10/19/07 22:21:51 (11 months ago)
Author:
mtredinnick
Message:

Fixed #4854 -- Recommended the use of forward slashes even in Windows configuration, to avoid having to worry about double-escaping issues. Based on a patch from adamv.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/modpython.txt

    r6182 r6536  
    8888path. 
    8989 
    90 .. caution:: 
    91  
    92     If you're using Windows, remember that the path will contain backslashes. 
    93     This string is passed through Python's string parser twice, so you need to 
    94     escape each backslash **twice**:: 
    95  
    96         PythonPath "['c:\\\\path\\\\to\\\\project'] + sys.path" 
    97  
    98     Or, use raw strings:: 
    99  
    100         PythonPath "[r'c:\\path\\to\\project'] + sys.path" 
     90.. note:: 
     91 
     92    If you're using Windows, it is still recommended that you use forward 
     93    slashes in the pathnames, even though Windows normally uses backslashes 
     94    for its native separator. Apache knows how to convert from the forward 
     95    slash format to the native format, so this approach is portable and easier 
     96    to read (it avoids tricky problems with having to double-escape 
     97    backslashes). 
     98 
     99    This is valid even on a Windows system:: 
     100 
     101        PythonPath "['c:/path/to/project'] + sys.path" 
     102 
    101103 
    102104You can also add directives such as ``PythonAutoReload Off`` for performance.