~ubuntu-branches/ubuntu/dapper/libapache2-mod-python/dapper

« back to all changes in this revision

Viewing changes to doc-html/dir-other-pp.html

  • Committer: Bazaar Package Importer
  • Author(s): Thom May
  • Date: 2004-09-06 20:27:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040906202757-yzpyu1bcabgpjtiu
Tags: upstream-3.1.3
ImportĀ upstreamĀ versionĀ 3.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<title>5.4.11 PythonPath</title>
 
5
<META NAME="description" CONTENT="5.4.11 PythonPath">
 
6
<META NAME="keywords" CONTENT="modpython">
 
7
<META NAME="resource-type" CONTENT="document">
 
8
<META NAME="distribution" CONTENT="global">
 
9
<link rel="STYLESHEET" href="modpython.css">
 
10
<link rel="first" href="modpython.html">
 
11
<link rel="contents" href="contents.html" title="Contents">
 
12
<link rel="index" href="genindex.html" title="Index">
 
13
<LINK REL="previous" href="dir-other-po.html">
 
14
<LINK REL="up" href="dir-other.html">
 
15
<LINK REL="next" href="handlers.html">
 
16
</head>
 
17
<body>
 
18
<DIV CLASS="navigation">
 
19
<table align="center" width="100%" cellpadding="0" cellspacing="2">
 
20
<tr>
 
21
<td><A href="dir-other-po.html"><img src="icons/previous.gif"
 
22
  border="0" height="32"
 
23
  alt="Previous Page" width="32"></A></td>
 
24
<td><A href="dir-other.html"><img src="icons/up.gif"
 
25
  border="0" height="32"
 
26
  alt="Up One Level" width="32"></A></td>
 
27
<td><A href="handlers.html"><img src="icons/next.gif"
 
28
  border="0" height="32"
 
29
  alt="Next Page" width="32"></A></td>
 
30
<td align="center" width="100%">Mod_python Manual</td>
 
31
<td><A href="contents.html"><img src="icons/contents.gif"
 
32
  border="0" height="32"
 
33
  alt="Contents" width="32"></A></td>
 
34
<td><img src="icons/blank.gif"
 
35
  border="0" height="32"
 
36
  alt="" width="32"></td>
 
37
<td><A href="genindex.html"><img src="icons/index.gif"
 
38
  border="0" height="32"
 
39
  alt="Index" width="32"></A></td>
 
40
</tr></table>
 
41
<b class="navlabel">Previous:</b> <a class="sectref" href="dir-other-po.html">5.4.10 PythonOption</A>
 
42
<b class="navlabel">Up:</b> <a class="sectref" href="dir-other.html">5.4 Other Directives</A>
 
43
<b class="navlabel">Next:</b> <a class="sectref" href="handlers.html">6. Standard Handlers</A>
 
44
<br><hr>
 
45
</DIV>
 
46
<!--End of Navigation Panel-->
 
47
 
 
48
<H2><A NAME="SECTION0074110000000000000000">&nbsp;</A>
 
49
<a name="l2h-249">&nbsp;</a>
 
50
<BR>
 
51
5.4.11 PythonPath
 
52
</H2>
 
53
 
 
54
<P>
 
55
<b><em class="citetitle"><a
 
56
 href="http://httpd.apache.org/docs-2.0/mod/directive-dict.html#Syntax"
 
57
 title="Syntax:"
 
58
 >Syntax:</a></em></b>
 
59
PythonPath <i>path</i> 
 
60
<BR><em class="citetitle"><a
 
61
 href="http://httpd.apache.org/docs-2.0/mod/directive-dict.html#Context"
 
62
 title="Context:"
 
63
 >Context:</a></em>
 
64
server config, virtual host, directory, htaccess
 
65
<BR><em class="citetitle"><a
 
66
 href="http://httpd.apache.org/docs-2.0/mod/directive-dict.html#Override"
 
67
 title="Override:"
 
68
 >Override:</a></em>
 
69
not None
 
70
<BR><em class="citetitle"><a
 
71
 href="http://httpd.apache.org/docs-2.0/mod/directive-dict.html#Module"
 
72
 title="Module:"
 
73
 >Module:</a></em>
 
74
mod_python.c
 
75
 
 
76
<P>
 
77
PythonPath directive sets the PythonPath. The path must be specified
 
78
in Python list notation, e.g.
 
79
 
 
80
<P>
 
81
<dl><dd><pre class="verbatim">
 
82
  PythonPath "['/usr/local/lib/python2.0', '/usr/local/lib/site_python', '/some/other/place']"
 
83
</pre></dl>
 
84
 
 
85
<P>
 
86
The path specified in this directive will replace the path, not add to
 
87
it. However, because the value of the directive is evaled, to append a
 
88
directory to the path, one can specify something like
 
89
 
 
90
<P>
 
91
<dl><dd><pre class="verbatim">
 
92
  PythonPath "sys.path+['/mydir']"
 
93
</pre></dl>
 
94
 
 
95
<P>
 
96
Mod_python tries to minimize the number of evals associated with the
 
97
PythonPath directive because evals are slow and can negatively impact
 
98
performance, especially when the directive is specified in an
 
99
<span class="file">.htaccess</span> file which gets parsed at every hit. Mod_python will
 
100
remember the arguments to the PythonPath directive in the un-evaled
 
101
form, and before evaling the value it will compare it to the
 
102
remembered value. If the value is the same, no action is
 
103
taken. Because of this, you should not rely on the directive as a way
 
104
to restore the pythonpath to some value if your code changes it.
 
105
 
 
106
<P>
 
107
<div class="note"><b class="label">Note:</b>
 
108
This directive should not be used as a security measure since the
 
109
  Python path is easily manipulated from within the scripts.
 
110
</div>
 
111
 
 
112
<DIV CLASS="navigation">
 
113
<p><hr>
 
114
<table align="center" width="100%" cellpadding="0" cellspacing="2">
 
115
<tr>
 
116
<td><A href="dir-other-po.html"><img src="icons/previous.gif"
 
117
  border="0" height="32"
 
118
  alt="Previous Page" width="32"></A></td>
 
119
<td><A href="dir-other.html"><img src="icons/up.gif"
 
120
  border="0" height="32"
 
121
  alt="Up One Level" width="32"></A></td>
 
122
<td><A href="handlers.html"><img src="icons/next.gif"
 
123
  border="0" height="32"
 
124
  alt="Next Page" width="32"></A></td>
 
125
<td align="center" width="100%">Mod_python Manual</td>
 
126
<td><A href="contents.html"><img src="icons/contents.gif"
 
127
  border="0" height="32"
 
128
  alt="Contents" width="32"></A></td>
 
129
<td><img src="icons/blank.gif"
 
130
  border="0" height="32"
 
131
  alt="" width="32"></td>
 
132
<td><A href="genindex.html"><img src="icons/index.gif"
 
133
  border="0" height="32"
 
134
  alt="Index" width="32"></A></td>
 
135
</tr></table>
 
136
<b class="navlabel">Previous:</b> <a class="sectref" href="dir-other-po.html">5.4.10 PythonOption</A>
 
137
<b class="navlabel">Up:</b> <a class="sectref" href="dir-other.html">5.4 Other Directives</A>
 
138
<b class="navlabel">Next:</b> <a class="sectref" href="handlers.html">6. Standard Handlers</A>
 
139
<hr>
 
140
<span class="release-info">Release 3.1.3, documentation updated on February 17, 2004.</span>
 
141
</DIV>
 
142
<!--End of Navigation Panel-->
 
143
 
 
144
</BODY>
 
145
</HTML>