Django

Code

DjangoDocumentKoreanTranslation: modpython-ko.txt

File modpython-ko.txt, 27.1 kB (added by iam312 <iam312@dreamwiz.com>, 1 month ago)
Line 
1 =================================
2 >>!
3 How to use Django with mod_python
4 <<!
5 >>!!
6 mod_python에서 장고 욎영하Ʞ
7 <<!!
8 =================================
9
10 >>!
11 Apache_ with `mod_python`_ currently is the preferred setup for using Django
12 on a production server.
13 <<!
14 >>!!
15 Apache_ with `mod_python`_은 제품 서버(production server)에서 장고륌 사용하Ʞ 위핎
16 현재 가장 선혞되는 섀정ìž
17 니닀..
18 <<!!
19
20 >>!
21 mod_python is similar to `mod_perl`_ : It embeds Python within Apache and loads
22 Python code into memory when the server starts. Code stays in memory throughout
23 the life of an Apache process, which leads to significant performance gains over
24 other server arrangements.
25 <<!
26 >>!!
27 mod_python은 `mod_perl`_곌 유사합니닀 : 아파치 낎에서 파읎썬을 임베딩하고,
28 아파치가 시작할때 파읎썬 윔드륌 윔드륌 메몚늬에 로드합니닀.
29 윔드는 아파치 프로섞슀가 삎아있는 동안 메몚늬에 낚아 있윌며,
30 읎는 닀륞 서버구성볎닀 죌목할만한 성능 향상을 읎끌얎 ëƒ
31 니닀.
32 <<!!
33
34 >>!
35 Django requires Apache 2.x and mod_python 3.x, and you should use Apache's
36 `prefork MPM`_, as opposed to the `worker MPM`_.
37 <<!
38 >>!!
39 장고는 아파치 2.x 와 mod_python 3.x 륌 필요로 하며,
40 반드시 `worker MPM`_에 대비되는 `prefork MPM`_ 아파치륌 사용핎알 합니닀.
41 <<!!
42
43 >>!
44 You may also be interested in `How to use Django with FastCGI, SCGI or AJP`_
45 (which also covers SCGI and AJP).
46 <<!
47 >>!!
48 `FastCGI, SCGI 또는 AJP 에서 장고 욎영하Ʞ`_도 삎펎볎섞요.
49 (SCGI와 AJP 또한 닀룹니닀).
50 <<!!
51
52 .. _Apache: http://httpd.apache.org/
53 .. _mod_python: http://www.modpython.org/
54 .. _mod_perl: http://perl.apache.org/
55 .. _prefork MPM: http://httpd.apache.org/docs/2.2/mod/prefork.html
56 .. _worker MPM: http://httpd.apache.org/docs/2.2/mod/worker.html
57 >>!
58 .. _How to use Django with FastCGI, SCGI or AJP: ../fastcgi/
59 <<!
60 >>!!
61 .. _FastCGI, SCGI 또는 AJP에서 장고 욎영하Ʞ: ../fastcgi/
62 <<!!
63
64 >>!
65 Basic configuration
66 <<!
67 >>!!
68 Ʞ볞 섀정
69 <<!!
70 ===================
71
72 >>!
73 To configure Django with mod_python, first make sure you have Apache installed,
74 with the mod_python module activated.
75 <<!
76 >>!!
77 mod_python에서 장고륌 섀정하Ʞ 위핎서, 뚌저 여러분은 mod_python 몚듈읎 활성화된
78 아파치가 섀치되얎 있얎알 합니닀,
79 <<!!
80
81 >>!
82 Then edit your ``httpd.conf`` file and add the following::
83 <<!
84 >>!!
85 귞늬고 나서 여러분의 ``httpd.conf`` 파음을 엎얎서 닀음을 추가하십시였::
86 <<!!
87
88     <Location "/mysite/">
89         SetHandler python-program
90         PythonHandler django.core.handlers.modpython
91         SetEnv DJANGO_SETTINGS_MODULE mysite.settings
92         PythonDebug On
93     </Location>
94
95 >>!
96 ...and replace ``mysite.settings`` with the Python import path to your Django
97 project's settings file.
98 <<!
99 >>!!
100 ...귞늬고 ``mysite.settings``륌 여러분의 장고 프로젝튞의 섀정 파음에 대한 파읎썬 겜로로 대첎하십시였.
101 <<!!
102
103 >>!
104 This tells Apache: "Use mod_python for any URL at or under '/mysite/', using the
105 Django mod_python handler." It passes the value of ``DJANGO_SETTINGS_MODULE``
106 so mod_python knows which settings to use.
107 <<!
108 >>!!
109 읎는 아파치에게 지시륌 합니닀: "장고 mod_python 핞듀러륌 사용하여,
110 '/mysite/' 읎하의 얎떠한 URL에 대핎서든 mod_python을 사용하띌."
111 ``DJANGO_SETTINGS_MODULE``의 값을 전달하여
112 mod_python은 ì–Žë–€ 섀정을 사용핎알 하는지 알게 됩니닀.
113 (mod_python은 ì–Žë–€ 섀정을 사용핎알 하는지 ``DJANGO_SETTINGS_MODULE``의 값윌로 알수 있습니닀.)
114 <<!!
115
116 >>!
117 Note that we're using the ``<Location>`` directive, not the ``<Directory>``
118 directive. The latter is used for pointing at places on your filesystem,
119 whereas ``<Location>`` points at places in the URL structure of a Web site.
120 ``<Directory>`` would be meaningless here.
121 <<!
122 >>!!
123 ``<Directory>`` 지시자가 아니띌, ``<Location>`` 지시자가 사용되고 있는 것을 죌의하십시였.
124 전자는 여러분의 파음시슀í
125 œìƒì˜ 위치륌 가늬킀는데 반핮,
126 ``<Location>``은 웹사읎튞의 URL 구조상의 위치륌 가늬킵니닀.
127 여Ʞ서는 ``<Directory>`` 가 의믞 없습니닀.
128 <<!!
129
130 >>!
131 Also, if your Django project is not on the default ``PYTHONPATH`` for your
132 computer, you'll have to tell mod_python where your project can be found:
133 <<!
134 >>!!
135 또한, 만앜  여러분의 장고 프로젝튞가 컎퓚터의 Ʞ볞  ``PYTHONPATH``상에 없닀멎,
136 여러분의 프로젝튞륌 얎디서 찟아알 하는지륌 mod_python에게 알렀쀘알 합니닀.
137 <<!!
138
139 .. parsed-literal::
140
141     <Location "/mysite/">
142         SetHandler python-program
143         PythonHandler django.core.handlers.modpython
144         SetEnv DJANGO_SETTINGS_MODULE mysite.settings
145         PythonDebug On
146         **PythonPath "['/path/to/project'] + sys.path"**
147     </Location>
148
149 >>!
150 The value you use for ``PythonPath`` should include the parent directories of
151 all the modules you are going to import in your application. It should also
152 include the parent directory of the ``DJANGO_SETTINGS_MODULE`` location. This
153 is exactly the same situation as setting the Python path for interactive
154 usage. Whenever you try to import something, Python will run through all the
155 directories in ``sys.path`` in turn, from first to last, and try to import
156 from each directory until one succeeds.
157 <<!
158 >>!!
159 여러분읎 사용하는 ``PythonPath`` 값은 여러분의 얎플늬쌀읎ì
160 ˜ì—ì„œ import 하렀고 하는
161 몚든 몚듈듀의 부몚 디렉토늬륌 ꌭ 포핚핎알 합니닀. 또한 
162 ``DJANGO_SETTINGS_MODULE`` location 의 부몚 디렉토늬륌 포핚핎알 합니닀.
163 읎는 바로 파읎썬을 대화형윌로 사용할때
164 path륌 섀정하는 것곌 똑같은 상황ìž
165 니닀.
166 여러분읎 묎얞가륌 import 하렀 할때마닀, 파읎썬은 import 가 성공할 때까지
167 ``sys.path`` 안의 몚든 디렉토늬륌 처음부터 끝까지 찚례로 시도핎 ëŽ
168 니닀.
169 <<!!
170  
171 >>!
172 An example might make this clearer. Suppose
173 you have some applications under ``/usr/local/django-apps/`` (for example,
174 ``/usr/local/django-apps/weblog/`` and so forth), your settings file is at
175 ``/var/www/mysite/settings.py`` and you have specified
176 ``DJANGO_SETTINGS_MODULE`` as in the above example. In this case, you would
177 need to write your ``PythonPath`` directive as::
178 <<!
179 >>!!
180 예제륌 볎멎 확싀핎 집니닀. 가령
181 ``/usr/local/django-apps/`` 디렉토늬 아래에 여러분의 ì–Žë–€ 얎플늬쌀읎ì
182 ˜
183 (``/usr/local/django-apps/weblog/`` 같은)읎 있고, 여러분의 섀정 파음은
184 ``/var/www/mysite/settings.py`` 읎띌서 여러분은 ``DJANGO_SETTINGS_MODULE`` 륌
185 위의 예제처럌 섀정했습니닀. 읎 겜우, 여러분은 ``PythonPath`` 지시자륌
186 아래와 같읎 작성할 필요가 있습니닀::
187 <<!!
188
189         PythonPath "['/usr/local/django-apps/', '/var/www'] + sys.path"
190
191 >>!
192 With this path, ``import weblog`` and ``import mysite.settings`` will both
193 work. If you had ``import blogroll`` in your code somewhere and ``blogroll``
194 lived under the ``weblog/`` directory, you would *also* need to add
195 ``/usr/local/django-apps/weblog/`` to your ``PythonPath``. Remember: the
196 **parent directories** of anything you import directly must be on the Python
197 path.
198 <<!
199 >>!!
200 읎 path 에서, ``import weblog`` 와 ``import mysite.settings`` 둘 ë‹€ 작동합니닀. 만앜 여러분의
201 윔드 얎딘가에 ``import blogroll``가 있고 ``blogroll``읎 ``weblog/`` 디렉토늬
202 아래에 위치하고 있닀멎, 여러분은 *또한* ``/usr/local/django-apps/weblog/`` 륌
203 ``PythonPath`` 안에 넣얎알 합니닀.
204 Ʞ억하십시였:여러분읎 작접 import 하렀고 하는
205 몚든 것듀의 **부몚 디렉토늬**는 반드시 파읎썬 path 상에 있얎알 합니닀.
206 <<!!
207
208 .. note::
209    
210 >>!             
211     If you're using Windows, we still recommended that you use forward
212     slashes in the pathnames, even though Windows normally uses the backslash
213     character as its native separator. Apache knows how to convert from the
214     forward slash format to the native format, so this approach is portable and
215     easier to read. (It avoids tricky problems with having to double-escape
216     backslashes.)
217 <<!
218 >>!!
219     만앜 여러분읎 Windows륌 사용쀑읎띌멎, 음반적윌로 Windows는 역슬래시 묞자(\)륌
220     욎영첎제의 겜로 구분자로 사용하지만, 우늬는 여전히 슬래시(/)륌 겜로에 사용할 것을
221     추천합니닀. 아파치는 슬래시 포맷을 얎떻게 욎영첎제 포맷윌로 변겜할지 알Ʞ 때묞에,
222     읎 방식읎 간펞하고(portable) 더 읜Ʞ 쉜습니닀.
223                 (읎는 읎쀑-읎슀쌀읎프 역슬래시(\\) 묞제륌
224     플하는 ꜁수ìž
225 니닀.)
226 <<!!
227
228 >>!
229     This is valid even on a Windows system::
230 <<!
231 >>!!
232     Windows 시슀í
233 œìƒì—ì„œ 읎것 역시 유횚합니닀::
234 <<!!
235
236         PythonPath "['c:/path/to/project'] + sys.path"
237
238 >>!
239 You can also add directives such as ``PythonAutoReload Off`` for performance.
240 See the `mod_python documentation`_ for a full list of options.
241 <<!
242 >>!!
243 여러분은 또한 ``PythonAutoReload Off`` 지시자륌 성능을 위핎 추가할 수 있습니닀.
244 전첎 옵ì
245 ˜ë“€ì€ `mod_python 묞서`_에서 볌 수 있습니닀.
246 <<!!
247
248 >>!
249 Note that you should set ``PythonDebug Off`` on a production server. If you
250 leave ``PythonDebug On``, your users would see ugly (and revealing) Python
251 tracebacks if something goes wrong within mod_python.
252 <<!
253 >>!!
254 여러분은 제품 서버(production server)상에서는 반드시 ``PythonDebug Off``로 섀정핎알 합니닀.
255 ``PythonDebug On`` 읞채로 두멎, 만앜 mod_python 안에서 뭔가 잘못 되었을때
256  ì—¬ëŸ¬ë¶„의 사용자듀은 볎Ʞ흉한(귞늬고 적나띌한) 파읎썬 traceback 듀을 볎게 될것ìž
257 니닀.
258  <<!!
259
260 >>!
261 Restart Apache, and any request to /mysite/ or below will be served by Django.
262 Note that Django's URLconfs won't trim the "/mysite/" -- they get passed the
263 full URL.
264 <<!
265 >>!!
266 아파치륌 재 시작하멎, /mysite/ 또는 ê·ž 아래의 얎떠한 요청에 대핎서도 장고가 처늬륌 합니닀.
267 장고의 URLconf는 "/mysite/" 륌 trim 하지 않음을 죌의 하십시였 -- full URL읎 전달됩니닀.
268  
269 <<!!
270
271 >>!
272 When deploying Django sites on mod_python, you'll need to restart Apache each
273 time you make changes to your Python code.
274 <<!
275 >>!!
276 장고륌 mod_python윌로 욎용할때, 여러분의 파읎썬 윔드륌 변겜할때마닀
277 아파치륌 재 시작할 필요가 있습니닀.
278 <<!!
279
280 >>!
281 Multiple Django installations on the same Apache
282 <<!
283 >>!!
284 한 아파치상에서 장고 닀쀑 섀치
285 <<!!
286 ================================================
287
288 >>!
289 It's entirely possible to run multiple Django installations on the same Apache
290 instance. Just use ``VirtualHost`` for that, like so::
291 <<!
292 >>!!
293 한 아파치 읞슀턎슀 상에서 닀쀑 섀치된 장고륌 싀행 시킬 수 있습니닀. 바로 VirtualHost 륌
294 아래와 같읎 사용합니닀::
295 <<!!
296
297     NameVirtualHost *
298
299     <VirtualHost *>
300         ServerName www.example.com
301         # ...
302         SetEnv DJANGO_SETTINGS_MODULE mysite.settings
303     </VirtualHost>
304
305     <VirtualHost *>
306         ServerName www2.example.com
307         # ...
308         SetEnv DJANGO_SETTINGS_MODULE mysite.other_settings
309     </VirtualHost>
310
311 >>!
312 If you need to put two Django installations within the same ``VirtualHost``,
313 you'll need to take a special precaution to ensure mod_python's cache doesn't
314 mess things up. Use the ``PythonInterpreter`` directive to give different
315 ``<Location>`` directives separate interpreters::
316 <<!
317 >>!!
318 만앜 여러분읎 같은 ``VirtualHost``에서 두개의 장고륌 섀치할 필요가 있닀멎,
319 여러분은 mod_python의 캐시가 ꌬ읎지 않도록 하Ʞ 위한 특별한 예방ì±
320 읎 필요합니닀.
321 ``PythonInterpreter`` 지시자륌 사용하여 각Ʞ 닀륞 ``<Location>`` 지시자듀읎 읞터프늬터륌
322 분늬하도록 하십시였::
323 <<!!
324
325     <VirtualHost *>
326         ServerName www.example.com
327         # ...
328         <Location "/something">
329             SetEnv DJANGO_SETTINGS_MODULE mysite.settings
330             PythonInterpreter mysite
331         </Location>
332
333         <Location "/otherthing">
334             SetEnv DJANGO_SETTINGS_MODULE mysite.other_settings
335             PythonInterpreter othersite
336         </Location>
337     </VirtualHost>
338
339 >>!
340 The values of ``PythonInterpreter`` don't really matter, as long as they're
341 different between the two ``Location`` blocks.
342 <<!
343 >>!!
344 각Ʞ 닀륞 두개의 ``Location`` 뾔럭 안에 있는 한, ``PythonInterpreter`` 의 값은
345 전혀 묞제되지 않습니닀.
346 <<!!
347
348 >>!
349 Running a development server with mod_python
350 <<!
351 >>!!
352 mod_python에서 개발 서버(developement server) 싀행하Ʞ
353 <<!!
354 ============================================
355
356 >>!
357 If you use mod_python for your development server, you can avoid the hassle of
358 having to restart the server each time you make code changes. Just set
359 ``MaxRequestsPerChild 1`` in your ``httpd.conf`` file to force Apache to reload
360 everything for each request. But don't do that on a production server, or we'll
361 revoke your Django privileges.
362 <<!
363 >>!!
364 만앜 여러분읎 개발 서버(developement server)에서 mod_python을 사용한닀멎,
365 여러분은 윔드륌 바꿀때마닀 아파치륌 재시작 핎알하는 불펞핚을 플할 수 있습니닀.
366 바로 ``httpd.conf`` 파음에 ``MaxRequestsPerChild 1``을 섀정하여 ë§€ 요청마닀 강제로 아파치가 몚든것을 늬로드 하도록 합니닀.
367 하지만 제품 서버(production server) 상에서는 읎렇게 하지 마십시였. 귞렇지 않윌멎,
368 여러분의 장고 권한듀을 재혞출합니닀.
369 <<!!
370
371 >>!
372 If you're the type of programmer who debugs using scattered ``print``
373 statements, note that ``print`` statements have no effect in mod_python; they
374 don't appear in the Apache log, as one might expect. If you have the need to
375 print debugging information in a mod_python setup, either do this::
376 <<!
377 >>!!
378 만앜 여러분읎 여Ʞ저Ʞ 흩얎진 ``print`` 묞을 사용하여 디버ê¹
379 하는 프로귞래뚞 부류띌멎,
380 mod_python 에서 ``print`` 묞은 아묎 횚곌가 없음을 죌의 하십시였; 혹시 Ʞ대했을지 몚륌,
381 아파치 로귞에도 볎읎지 않습니닀. 만앜 mod_python 환겜에서
382 디버ê¹
383  ì •볎륌 ꌭ 찍얎알 할 필요가 있닀멎, 읎렇게 하십시였::
384 <<!!
385
386 >>!
387     assert False, the_value_i_want_to_see
388 <<!
389 >>!!
390     assert False, 낎가 알고 싶은 값
391 <<!!
392
393 >>!
394 Or add the debugging information to the template of your page.
395 <<!
396 >>!!
397 혹은 디버ê¹
398  ì •볎륌 여러분 페읎지의 í
399 œí”ŒëŠ¿ì— 추가 하십시였.
400 <<!!
401
402 >>!
403 .. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html
404 <<!
405 >>!!
406 .. _mod_python 묞서: http://modpython.org/live/current/doc-html/directives.html
407 <<!!
408
409 >>!
410 Serving media files
411 <<!
412 >>!!
413 믞디얎 파음 처늬하Ʞ
414 <<!!
415 ===================
416
417 >>!
418 Django doesn't serve media files itself; it leaves that job to whichever Web
419 server you choose.
420 <<!
421 >>!!
422 장고 자첎는 믞디얎 파음듀을 처늬하지 않습니닀; 장고는 ê·ž 작ì—
423 을 여러분읎 선택한
424 웹 서버에게 낚깁니닀.
425 <<!!
426
427 >>!
428 We recommend using a separate Web server -- i.e., one that's not also running
429 Django -- for serving media. Here are some good choices:
430 <<!
431 >>!!
432 우늬는 분늬된 웹서버 — 바꿔말하멎, 장고륌 싀행하지 않는  — 믞디얎 처늬륌 위한
433 웹서버륌 사용할것을 추천합니닀. 여Ʞ 몇가지 좋은 선택읎 있습니닀:
434 <<!!
435
436 * lighttpd_
437 * TUX_
438 * A stripped-down version of Apache_
439
440 >>!
441 If, however, you have no option but to serve media files on the same Apache
442 ``VirtualHost`` as Django, here's how you can turn off mod_python for a
443 particular part of the site::
444 <<!
445 >>!!
446 귞렇지만, 만앜 여러분읎 선택의 여지가 없고
447 장고가 싀행되는 동음 아파치 ``VirtualHost`` 상에서 믞디얎 파음듀을 처늬핎알 한닀멎,
448 사읎튞 특정 부분의 mod_python 을 끄는 방법읎 있습니닀::
449 <<!!
450
451     <Location "/media">
452         SetHandler None
453     </Location>
454
455 >>!
456 Just change ``Location`` to the root URL of your media files. You can also use
457 ``<LocationMatch>`` to match a regular expression.
458 <<!
459 >>!!
460 바로 ``Location``을 믞디얎 파음듀의 룚튞 URL로 변겜하십시였.
461 여러분은 정규 표현식윌로 맀치하Ʞ 위핎 ``<LocationMatch>``륌 사용할 수도 있습니닀.
462 <<!!
463
464 >>!
465 This example sets up Django at the site root but explicitly disables Django for
466 the ``media`` subdirectory and any URL that ends with ``.jpg``, ``.gif`` or
467 ``.png``::
468 <<!
469 >>!!
470 읎 예는 사읎튞 룚튞에 장고륌 섀정하지만 ``media`` 서람디렉토늬와
471 ``.jpg``, ``.gif`` 또는 ``.png``로 끝나는 URL은 장고륌 불가능하게 하는
472 섀정을 합니닀::
473 <<!!
474
475     <Location "/">
476         SetHandler python-program
477         PythonHandler django.core.handlers.modpython
478         SetEnv DJANGO_SETTINGS_MODULE mysite.settings
479     </Location>
480
481     <Location "/media">
482         SetHandler None
483     </Location>
484
485     <LocationMatch "\.(jpg|gif|png)$">
486         SetHandler None
487     </LocationMatch>
488
489
490 .. _lighttpd: http://www.lighttpd.net/
491 .. _TUX: http://en.wikipedia.org/wiki/TUX_web_server
492 .. _Apache: http://httpd.apache.org/
493
494 >>!
495 Serving the admin files
496 <<!
497 >>!!
498 admin 파음듀 처늬하Ʞ
499 <<!!
500 =======================
501
502 >>!
503 Note that the Django development server automagically serves admin media files,
504 but this is not the case when you use any other server arrangement. You're
505 responsible for setting up Apache, or whichever media server you're using, to
506 serve the admin files.
507 <<!
508 >>!!
509 장고 개발 서버는 자동윌로 admin media 파음듀을 처늬합니닀만, 닀륞 서버구성을
510 사용할 겜우는 읎에 핎당하지 않음을 죌의 하십시였. admin 파음듀을 처늬하Ʞ 위핎,
511 아파치, 또는 여러분읎 사용쀑읞 얎떠한 믞디얎 서버에 대한 섀정을
512 여러분읎 핎알 합니닀.
513 <<!!
514
515 >>!
516 The admin files live in (``django/contrib/admin/media``) of the Django
517 distribution.
518 <<!
519 >>!!
520 admin 파음은 장고 배포판의 (``django/contrib/admin/media``) 에
521 위치합니닀.
522 <<!!
523
524 >>!
525 Here are two recommended approaches:
526 <<!
527 >>!!
528 여Ʞ 두가지 추천 방법읎 있습니닀:
529 <<!!
530
531 >>!
532     1. Create a symbolic link to the admin media files from within your
533        document root. This way, all of your Django-related files -- code
534        **and** templates -- stay in one place, and you'll still be able to
535        ``svn update`` your code to get the latest admin templates, if they
536        change.
537     2. Or, copy the admin media files so that they live within your Apache
538        document root.
539 <<!
540 >>!!
541     1. 여러분의 document root 낎에 admin media 파음듀에 대한 심볌늭 링크륌 만듭니닀.
542        ìŽ 겜우, 여러분의 몚든 장고 ꎀ렚 파음듀 -- 윔드 **귞늬고** í
543 œí”ŒëŠ¿ë“€ -— 은
544        í•œ 장소에 있게되며, 여러분은 여전히 변겜된 최신의
545                          admin í
546 œí”ŒëŠ¿ë“€ì„ 얻Ʞ 위핎,
547        ``svn update``륌 할 수 있습니닀.
548     2. 또는, 여러분의 아파치 document root 안에
549                 admin media 파음듀을 복사합니닀.
550 <<!!
551
552 >>!
553 Using eggs with mod_python
554 <<!
555 >>!!
556 mod_python에서 eggs 사용하Ʞ
557 <<!!
558 ==========================
559
560 >>!
561 If you installed Django from a Python egg_ or are using eggs in your Django
562 project, some extra configuration is required. Create an extra file in your
563 project (or somewhere else) that contains something like the following::
564 <<!
565 >>!!
566 만앜 Python egg_에서 장고륌 섀치했거나 장고 프로젝튞에 egg륌 사용 쀑읎띌멎,
567 추가 섀정읎 필요합니닀. 여러분의 프로젝튞(또는 얎딘가에)에 아래와 같은 낎용을 포핚하는
568 별도의 파음을 생성하십시였::
569 <<!!
570
571     import os
572     os.environ['PYTHON_EGG_CACHE'] = '/some/directory'
573
574 >>!
575 Here, ``/some/directory`` is a directory that the Apache webserver process can
576 write to. It will be used as the location for any unpacking of code the eggs
577 need to do.
578 <<!
579 >>!!
580 여Ʞ, ``/some/directory`` 는 아파치 웹서버 프로섞슀가
581 쓰Ʞ륌 하는 디렉토늬ìž
582 니닀.
583 egg가 필요로 하는 윔드듀의 압축을 푾는 위치로 사용됩니닀.
584 <<!!
585
586 >>!
587 Then you have to tell mod_python to import this file before doing anything
588 else. This is done using the PythonImport_ directive to mod_python. You need
589 to ensure that you have specified the ``PythonInterpreter`` directive to
590 mod_python as described above__ (you need to do this even if you aren't
591 serving multiple installations in this case). Then add the ``PythonImport``
592 line in the main server configuration (i.e., outside the ``Location`` or
593 ``VirtualHost`` sections). For example::
594 <<!
595 >>!!
596 귞늬고나서 여러분은 mod_python에게 닀륞 묎엇볎닀도 뚌저
597 읎 파음을 import 할것을 지시핎알 합니닀.
598 읎는 mod_python에 PythonImport_ 지시자륌 사용하멎 됩니닀.
599 여러분은 mod_python에 위__에서 ì„€ëª
600 한대로
601 ``PythonInterpreter`` 지시자륌
602 ëª
603 시핎둬알 합니닀
604 (여러분은 읎 겜우 닀쀑 섀치륌 사용 하지 않더띌도 읎것을 핎알 합니닀). 귞늬고 나서 ``PythonImport`` 쀄을 메읞 서버 섀정에 추가 하십시였(슉, ``Location`` 또는 ``VirtualHost`` 섹ì
605 ˜ì˜ 바깥). 예륌 듀얎::
606 <<!!
607
608     PythonInterpreter my_django
609     PythonImport /path/to/my/project/file.py my_django
610
611 >>!
612 Note that you can use an absolute path here (or a normal dotted import path),
613 as described in the `mod_python manual`_. We use an absolute path in the
614 above example because if any Python path modifications are required to access
615 your project, they will not have been done at the time the ``PythonImport``
616 line is processed.
617 <<!
618 >>!!
619 여러분은 `mod_python 맀뉎얌`_에서 ì„€ëª
620 한 대로
621 절대 겜로(또는 음반적읞 도튾 import 겜로)륌 사용할 수 있습니닀. 우늬는 여러분의
622 프로젝튞에 ì ‘ê·Œ 하Ʞ 위핎 파읎썬 path 수정읎 필요할 수도 있는데,
623 ``PythonImport`` 띌읞읎 처늬되는 시점에서는 읎것읎 아직  완료가 되지 않았Ʞ 때묞에
624 위의 예제에서 우늬는 절대 겜로륌 사용했습니닀.
625 <<!!
626
627 .. _Egg: http://peak.telecommunity.com/DevCenter/PythonEggs
628 .. _PythonImport: http://www.modpython.org/live/current/doc-html/dir-other-pimp.html
629 >>!
630 .. _mod_python manual: PythonImport_
631 __ `Multiple Django installations on the same Apache`_
632 <<!
633 >>!!
634 .. _mod_python 맀뉎얌: PythonImport_
635 __ `한 아파치 상에서 장고 닀쀑 섀치`_
636 <<!!
637
638 >>!
639 Error handling
640 <<!
641 >>!!
642 에러 처늬
643 <<!!
644 ==============
645
646 >>!
647 When you use Apache/mod_python, errors will be caught by Django -- in other
648 words, they won't propagate to the Apache level and won't appear in the Apache
649 ``error_log``.
650 <<!
651 >>!!
652 여러분읎 아파치/mod_python을 사용할 때, 에러는 장고에 의핎 잡힙니닀  -- 닀륞 말로,
653 에러륌 아파치 레벚에 전파 하지 않윌며, 아파치 ``error_log`` 에도
654 나타나지 않습니닀.
655 <<!!
656
657 >>!
658 The exception for this is if something is really wonky in your Django setup. In
659 that case, you'll see an "Internal Server Error" page in your browser and the
660 full Python traceback in your Apache ``error_log`` file. The ``error_log``
661 traceback is spread over multiple lines. (Yes, this is ugly and rather hard to
662 read, but it's how mod_python does things.)
663 <<!
664 >>!!
665 읎에 대한 예왞는 여러분의 장고 프로귞랚에서 묎얞가 정말 있을 수 없는 음읎
666 발생한 겜우ìž
667 니닀. 읎 겜우, 여러분은 람띌우저에서 "Internal Server Error" 페읎지륌
668 볎게 될 것읎며 full Python traceback 읎 아파치 ``error_log`` 파음에 낚겚집니닀.
669 ``error_log`` traceback은 여러쀄에 걞쳐 출력됩니닀. (예, 읎것은
670 볎Ʞ 흉하고 읜Ʞ도 얎렵습니닀만, 읎게 mod_python 읎 처늬하는 방식ìž
671 니닀.)
672 <<!!
673
674 >>!
675 If you get a segmentation fault
676 <<!
677 >>!!
678 segment fault 가 났닀멎
679 <<!!
680 ===============================
681
682 >>!
683 If Apache causes a segmentation fault, there are two probable causes, neither
684 of which has to do with Django itself.
685 <<!
686 >>!!
687 만앜 아파치가 segment fault 륌 낞닀멎, 두가지 예상 원읞읎 있는데,
688 둘닀 장고 자첎의 묞제가 아닙니닀.
689 <<!!
690
691 >>!
692     1. It may be because your Python code is importing the "pyexpat" module,
693        which may conflict with the version embedded in Apache. For full
694        information, see `Expat Causing Apache Crash`_.
695     2. It may be because you're running mod_python and mod_php in the same
696        Apache instance, with MySQL as your database backend. In some cases,
697        this causes a known mod_python issue due to version conflicts in PHP and
698        the Python MySQL backend. There's full information in the
699        `mod_python FAQ entry`_.
700 <<!
701 >>!!
702     1. 여러분의 파읎썬 윔드가 아파치에 임베딩된 버전곌
703       충돌나는 "pyexpat" 몚듈을 임포íŒ
704  í•˜ê³  있Ʞ 때묞음 수 있습니닀.
705       전첎 정볎는 `Expat Causing Apache Crash`_ 륌 볎십시였.
706     2. 여러분읎 데읎터베읎슀 후닚부로 MySQL을 사용하여 mod_python곌 mod_php륌
707       동음 아파치 읞슀턎슀에서 싀행쀑읎Ʞ 때묞음 수 있습니닀. ì–Žë–€ 겜우,
708       읎는 PHP와 Python의 MySQL 후닚부에서의 버전 충돌에 의한 것윌로 알렀진
709       mod_python 읎슈륌 음윌킵니닀.
710                         `mod_python FAQ entry`_에 전첎 정볎가 있습니닀.
711 <<!!
712      
713 >>!
714 If you continue to have problems setting up mod_python, a good thing to do is
715 get a barebones mod_python site working, without the Django framework. This is
716 an easy way to isolate mod_python-specific problems. `Getting mod_python Working`_
717 details this procedure.
718 <<!
719 >>!!
720 만앜 여러분에게 mod_python 섀정 묞제가 계속된닀멎,
721 장고 프레임워크 없읎, mod_python Ʞ볞 사읎튞가 잘 작동하도록 하십시였.
722 읎는 mod_python 에 한정된 묞제륌 고늜시킀는 쉬욎 방법ìž
723 니닀.
724 `Getting mod_python Working`_에 읎 절찚가 자섞하게 있습니닀.
725 <<!!
726
727 >>!
728 The next step should be to edit your test code and add an import of any
729 Django-specific code you're using -- your views, your models, your URLconf,
730 your RSS configuration, etc. Put these imports in your test handler function
731 and access your test URL in a browser. If this causes a crash, you've confirmed
732 it's the importing of Django code that causes the problem. Gradually reduce the
733 set of imports until it stops crashing, so as to find the specific module that
734 causes the problem. Drop down further into modules and look into their imports,
735 as necessary.
736 <<!
737 >>!!
738 닀음 닚계는 í
739 ŒìŠ€íŠž 윔드륌 엎얎서 여러분읎 사용하는 장고 ꎀ렚 윔드 —
740 view, model, URLconf, RSS 섀정 따위 등에 대한 몚든 import 듀을 추가 하십시였.
741 읎듀 import듀을 여러분의 í
742 ŒìŠ€íŠž 핞듀러 핚수에 넣고 람띌우저에서
743 여러분의 í
744 ŒìŠ€íŠž URL에 접속하십시였. 만앜 읎것읎 묞제륌 발생시킚닀멎,
745 import 한 장고 윔드듀읎 묞제륌 음윌킀는 것임읎 확읞된 것ìž
746 니닀. 크래시가
747 멈출때까지 import 륌 점찚적윌로 쀄여나가서, 묞제륌 말생시킀는
748 특정 몚듈을 찟습니닀. 필요하닀멎 핎당 몚듈 안윌로 더 듀얎가
749 ê·ž 곳의 import 듀을 조사합니닀.
750 <<!!
751
752 .. _Expat Causing Apache Crash: http://www.dscpl.com.au/articles/modpython-006.html
753 .. _mod_python FAQ entry: http://modpython.org/FAQ/faqw.py?req=show&file=faq02.013.htp
754 .. _Getting mod_python Working: http://www.dscpl.com.au/articles/modpython-001.html