WebFaction
Community site: login faq

Hi,

I was wondering how I could use PDB to debug my python Django code. This tutorial (http://ericholscher.com/blog/2008/aug/31/using-pdb-python-debugger-django-debugging-series-/) tells me that the debugger would work on my console after I do a manage.py runserver, and was wondering how that would work on my webfaction server. Would appreciate any help :)

Thanks

asked 08 Oct '11, 23:57

iman453
491527
accept rate: 0%


You will need to setup a Custom Application and make sure you use the port assigned by it, also bind to 127.0.0.1,

manage.py runserver 127.0.0.1:1234
permanent link

answered 09 Oct '11, 00:04

johns
5.4k312
accept rate: 23%

Hi, thanks for your reply! Sorry, I'm a little confused. Once I set up this custom listening on port app, do I have to create a Django app there? I already have a django app that I want to debug. How would the process go? Sorry if this is a stupid question

(09 Oct '11, 15:32) iman453

Not a stupid question at all!

You don't need to create a new Django app - however you will need to create a new site to serve the custom app. Once you've done that, you can then visit that site to do whatever needs to happen to hit your breakpoint. Once you do that, the dev server will drop into pdb and you can debug from there.

Strictly speaking, you do not need a separate custom application. Instead, you can just stop the Apache instance that is currently serving your app, then start the Django dev server on the port assign to your Apache. That way, you can visit your site on its normal URL while you debug it.

Finally, it's also possible to debug the app while it's running under mod_wsgi - instructions are available here: Debugging techniques for WSGI applications

Hope that helps!

(09 Oct '11, 16:28) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×337
×13

question asked: 08 Oct '11, 23:57

question was seen: 4,189 times

last updated: 09 Oct '11, 16:28

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM