1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<title>5.4.3 PythonImport</title>
5
<META NAME="description" CONTENT="5.4.3 PythonImport">
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="next" href="dir-other-ipd.html">
14
<LINK REL="previous" href="dir-other-pd.html">
15
<LINK REL="up" href="dir-other.html">
16
<LINK REL="next" href="dir-other-ipd.html">
19
<DIV CLASS="navigation">
20
<table align="center" width="100%" cellpadding="0" cellspacing="2">
22
<td><A href="dir-other-pd.html"><img src="icons/previous.gif"
23
border="0" height="32"
24
alt="Previous Page" width="32"></A></td>
25
<td><A href="dir-other.html"><img src="icons/up.gif"
26
border="0" height="32"
27
alt="Up One Level" width="32"></A></td>
28
<td><A href="dir-other-ipd.html"><img src="icons/next.gif"
29
border="0" height="32"
30
alt="Next Page" width="32"></A></td>
31
<td align="center" width="100%">Mod_python Manual</td>
32
<td><A href="contents.html"><img src="icons/contents.gif"
33
border="0" height="32"
34
alt="Contents" width="32"></A></td>
35
<td><img src="icons/blank.gif"
36
border="0" height="32"
37
alt="" width="32"></td>
38
<td><A href="genindex.html"><img src="icons/index.gif"
39
border="0" height="32"
40
alt="Index" width="32"></A></td>
42
<b class="navlabel">Previous:</b> <a class="sectref" href="dir-other-pd.html">5.4.2 PythonDebug</A>
43
<b class="navlabel">Up:</b> <a class="sectref" href="dir-other.html">5.4 Other Directives</A>
44
<b class="navlabel">Next:</b> <a class="sectref" href="dir-other-ipd.html">5.4.4 PythonInterpPerDirectory</A>
47
<!--End of Navigation Panel-->
49
<H2><A NAME="SECTION007430000000000000000"> </A>
50
<a name="l2h-241"> </a>
56
<b><em class="citetitle"><a
57
href="http://httpd.apache.org/docs-2.0/mod/directive-dict.html#Syntax"
60
PythonImport <i>module</i> <i>interpreter_name</i>
61
<BR><em class="citetitle"><a
62
href="http://httpd.apache.org/docs-2.0/mod/directive-dict.html#Context"
66
<BR><em class="citetitle"><a
67
href="http://httpd.apache.org/docs-2.0/mod/directive-dict.html#Module"
73
Tells the server to import the Python module module at process startup
74
under the specified interpreter name. This is useful for
75
initialization tasks that could be time consuming and should not be
76
done at the request processing time, e.g. initializing a database
80
The import takes place at child process initialization, so the module
81
will actually be imported once for every child process spawned.
84
<div class="note"><b class="label">Note:</b>
85
At the time when the import takes place, the configuration is not
86
completely read yet, so all other directives, including
87
PythonInterpreter have no effect on the behavior of modules imported
88
by this directive. Because of this limitation, the interpreter must
89
be specified explicitly, and must match the name under which
90
subsequent requests relying on this operation will execute. If you
91
are not sure under what interpreter name a request is running,
92
examine the <tt class="member">interpreter</tt> member of the request object.
96
See also Multiple Interpreters.
100
<DIV CLASS="navigation">
102
<table align="center" width="100%" cellpadding="0" cellspacing="2">
104
<td><A href="dir-other-pd.html"><img src="icons/previous.gif"
105
border="0" height="32"
106
alt="Previous Page" width="32"></A></td>
107
<td><A href="dir-other.html"><img src="icons/up.gif"
108
border="0" height="32"
109
alt="Up One Level" width="32"></A></td>
110
<td><A href="dir-other-ipd.html"><img src="icons/next.gif"
111
border="0" height="32"
112
alt="Next Page" width="32"></A></td>
113
<td align="center" width="100%">Mod_python Manual</td>
114
<td><A href="contents.html"><img src="icons/contents.gif"
115
border="0" height="32"
116
alt="Contents" width="32"></A></td>
117
<td><img src="icons/blank.gif"
118
border="0" height="32"
119
alt="" width="32"></td>
120
<td><A href="genindex.html"><img src="icons/index.gif"
121
border="0" height="32"
122
alt="Index" width="32"></A></td>
124
<b class="navlabel">Previous:</b> <a class="sectref" href="dir-other-pd.html">5.4.2 PythonDebug</A>
125
<b class="navlabel">Up:</b> <a class="sectref" href="dir-other.html">5.4 Other Directives</A>
126
<b class="navlabel">Next:</b> <a class="sectref" href="dir-other-ipd.html">5.4.4 PythonInterpPerDirectory</A>
128
<span class="release-info">Release 3.1.3, documentation updated on February 17, 2004.</span>
130
<!--End of Navigation Panel-->