uWSGI altında python pdb hata ayıklayıcısını kullanmaya çalıştığımda, yürütme kesme noktasında durmuyor, yalnızca geri izlemeye dönüyor. Bunu çalıştırmak nasıluWSGI altında python uygulaması nasıl hata ayıklanır?
def application(env, start_response):
import pdb; pdb.set_trace()
start_response('200 OK', [('Content-Type','text/html')])
return "Hello World"
şudur: Burada
koduduruwsgi --http 127.0.0.1:7777 --wsgi-file uwsgi_test.py
ve bu elde ediyoruz:
/home/andrey/Development/ttt/uwsgi_test.py(3)application()
-> start_response('200 OK', [('Content-Type','text/html')])
(Pdb)
Traceback (most recent call last):
File "uwsgi_test.py", line 3, in application
start_response('200 OK', [('Content-Type','text/html')])
File "uwsgi_test.py", line 3, in application
start_response('200 OK', [('Content-Type','text/html')])
File "/usr/lib/python2.7/bdb.py", line 48, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/lib/python2.7/bdb.py", line 67, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
[pid: 11421|app: 0|req: 1/1] 127.0.0.1() {32 vars in 366 bytes} [Sun Aug 25 13:12:06 2013] GET/=> generated 0 bytes in 63 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
Farklı şekilde hata ayıklamayı denediniz mi (diğer bir deyişle, set_trace() işlevini kullanarak, kesme noktalarını elle ekleyerek yerine)? –
Herhangi bir IDE olmadan, basit bir metin editöründe geliştiriyorum. Bu yüzden bildiğim tek seçenek, kesme noktalarıdır. – Anderson
Bu postayı gözden geçirin: http://stackoverflow.com/questions/6980749/simpler-way-to-put-pdb-breakpoints-in-python-code İyi bir IDE'nin yanı sıra, hayatı sizin için çok daha kolaylaştırabilir (ve üretkenliği arttırmaya yardımcı olur. –