Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6b5dbaa6
Kaydet (Commit)
6b5dbaa6
authored
Şub 20, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
At least separate imports from other statements.
üst
4a698721
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
webservers.rst
Doc/howto/webservers.rst
+2
-1
cgi.rst
Doc/library/cgi.rst
+9
-6
cgitb.rst
Doc/library/cgitb.rst
+3
-2
No files found.
Doc/howto/webservers.rst
Dosyayı görüntüle @
6b5dbaa6
...
@@ -99,7 +99,8 @@ simple CGI program::
...
@@ -99,7 +99,8 @@ simple CGI program::
# -*- coding: UTF-8 -*-
# -*- coding: UTF-8 -*-
# enable debugging
# enable debugging
import cgitb; cgitb.enable()
import cgitb
cgitb.enable()
print "Content-Type: text/plain;charset=utf-8"
print "Content-Type: text/plain;charset=utf-8"
print
print
...
...
Doc/library/cgi.rst
Dosyayı görüntüle @
6b5dbaa6
...
@@ -67,16 +67,18 @@ Begin by writing ``import cgi``. Do not use ``from cgi import *`` --- the
...
@@ -67,16 +67,18 @@ Begin by writing ``import cgi``. Do not use ``from cgi import *`` --- the
module defines all sorts of names for its own use or for backward compatibility
module defines all sorts of names for its own use or for backward compatibility
that you don't want in your namespace.
that you don't want in your namespace.
When you write a new script, consider adding the
line
::
When you write a new script, consider adding the
se lines
::
import cgitb; cgitb.enable()
import cgitb
cgitb.enable()
This activates a special exception handler that will display detailed reports in
This activates a special exception handler that will display detailed reports in
the Web browser if any errors occur. If you'd rather not show the guts of your
the Web browser if any errors occur. If you'd rather not show the guts of your
program to users of your script, you can have the reports saved to files
program to users of your script, you can have the reports saved to files
instead, with
a lin
e like this::
instead, with
cod
e like this::
import cgitb; cgitb.enable(display=0, logdir="/tmp")
import cgitb
cgitb.enable(display=0, logdir="/tmp")
It's very helpful to use this feature during script development. The reports
It's very helpful to use this feature during script development. The reports
produced by :mod:`cgitb` provide information that can save you a lot of time in
produced by :mod:`cgitb` provide information that can save you a lot of time in
...
@@ -470,9 +472,10 @@ discarded altogether.
...
@@ -470,9 +472,10 @@ discarded altogether.
Fortunately, once you have managed to get your script to execute *some* code,
Fortunately, once you have managed to get your script to execute *some* code,
you can easily send tracebacks to the Web browser using the :mod:`cgitb` module.
you can easily send tracebacks to the Web browser using the :mod:`cgitb` module.
If you haven't done so already, just add the line::
If you haven't done so already, just add the line
s
::
import cgitb; cgitb.enable()
import cgitb
cgitb.enable()
to the top of your script. Then try running it again; when a problem occurs,
to the top of your script. Then try running it again; when a problem occurs,
you should see a detailed report that will likely make apparent the cause of the
you should see a detailed report that will likely make apparent the cause of the
...
...
Doc/library/cgitb.rst
Dosyayı görüntüle @
6b5dbaa6
...
@@ -26,9 +26,10 @@ as well as the values of the arguments and local variables to currently running
...
@@ -26,9 +26,10 @@ as well as the values of the arguments and local variables to currently running
functions, to help you debug the problem. Optionally, you can save this
functions, to help you debug the problem. Optionally, you can save this
information to a file instead of sending it to the browser.
information to a file instead of sending it to the browser.
To enable this feature, simply add
one line
to the top of your CGI script::
To enable this feature, simply add
this
to the top of your CGI script::
import cgitb; cgitb.enable()
import cgitb
cgitb.enable()
The options to the :func:`enable` function control whether the report is
The options to the :func:`enable` function control whether the report is
displayed in the browser and whether the report is logged to a file for later
displayed in the browser and whether the report is logged to a file for later
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment