i was working in a project with a very complex logic, and i mixed up
with logical problems in the code. i used some debugging methods and
tools like ipdb, pdb.set_trace(), django-command-extension and etc. but
at last i end up with a little django patch #15249.
that patch provide a easy way to debug django code at the exception
raise time. i discussed about the inline debugging idea in irc developer
channel with some cool guys :D, and i decided to post this mail to
share the idea with others and get their ideas.
what does #15249 patch do?
it run a pdb or ipython shell when an exception raised with the
namespaces of raised trackback, (if settigns.INLINE_DEBUGGER set to
correct value), so it will be very easy to test some code.
why don't you use:
* pdb.set_trace()?
because i have to write some code in each module that i want to debug
and also i can't test some code snippet in the runtime env (as far as i
know)
* ipdb?
same as pdb and its and external module and i cant expect my friend to
install that too.
* django-command-extension?
it's an external tool too, its very cool but don't have some of ipython
feature like code completer.
#15249 patch is a little and lazy code, but it will be a good idea for
django to provide such functionality.
what's your idea about it ?
i know, i talk to much :P
My biggest problem with this proposal is that it plants itself in the
main HTTP stack. That means it's in the code path when you deploy your
code into production.
I have no objection to the idea of making it easier to debug problems
when they occur, but it should be constrained to the development
server.
Better still, it should be something that can be implemented as an
entirely external tool, accessing a hook provided by the development
server. I don't know what that hook would look like exactly, but in
general, adding hooks is an easier sell than adding settings to
enable/disable functionality.
Yours,
Russ Magee %-)
--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to django-d...@googlegroups.com.
To unsubscribe from this group, send email to django-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
That's fine, and I can agree with the sentiment -- but it's also not
what you included in your patch. I can only comment effectively on
code that I can actually see.
I would also point out that a hardcoded solution allow for exactly one
solution -- the solution you provide. However, if you provide a hook,
the entire community can collaborate to build bigger and better tools
that exploit that hook. That doesn't preclude shipping an
out-of-the-box, easy-to-use tool that exploits the same hook.
Yours,
Russ Magee %-)
On Thu, Feb 10, 2011 at 8:44 AM, Matteius <matt...@gmail.com> wrote:
>
> What I want to see (and possibly the closest I've seen it with was a
> video on the django_command_extensions) is an interactive debugger
> built into my test-dev server so I can have break pts, switch logic
> values in place, etc. dynamically on the test-dev server.
>
Have you guys looked at django-extensions[1] `runserver_plus` together
with Werkzeug's debugger[2]? On an exception, the error page provides
an interactive console on every level of the stack trace. No need to
modify Django, it just works(tm).
Regards,
Benjamin
[1]: https://github.com/django-extensions/django-extensions
[2]: http://werkzeug.pocoo.org/docs/debug/
--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to django-d...@googlegroups.com.
To unsubscribe from this group, send email to django-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
@benjamin
Django-command-extension is a really great tools but ipython is a robust
python shell with internal debugger autho completer and some many
features, there are many situation that runserver_plus does does not
come handy, also terminal is a great friend of a developer you have
terminal all time so you can always access a great ipyhton shell.
@Gabriel
as i told before that ticket and patch is just a lazy code that i write
to find my product problem and not the main solution, writing a inline
debugger need more consideration and a well design code.
i think debugging facilities help django user and developer to think
about there product and code not about solving problems and confusing
bugs.
A great framework should have a great development environment.