Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread ristretto.rb

All excellent ideas.  Great community here, thanks!!

To be clear, I have been coding Python and Django for a few weeks now,
and I've bought and read a few
books, poured over some online docs and tried to get confortable with
Komodo.

I don't really WANT to learn the internals of Django at this point.
(Perhaps someday, but right now I just want to use it.)
But, when something goes wrong, I need to figure out if it's in my
code, like something is misconfigured, or it's in Django.
After all, I'm sure you all would appreciate me doing as much leg work
as possible before reporting to this group.  It's
busy enough.  Since Django is a bunch of python scripts, as I've been
told, it isn't always clear where problems lie.

I don't often need a debugger to debug my own code.  Project isn't
that big yet, and I generally import logging, and write
unit tests.  But, when I want to learn about how my code dips into
Django, that's where a debugger and a comprehensive IDE
with "code intelligence" can really help.  I used to use Intellij IDEA
with Java, this is my reference for good "code intelligents".

I'll read up on pdb.  That's looks great.  Not sure if I'm going to
bother upgrading to the KomodoIDE.  I'm not too impressed so far.

Thanks for the pointer to comp.lang.py


On Jul 10, 9:31 am, bruno desthuilliers
<[EMAIL PROTECTED]> wrote:
> On 9 juil, 04:08, "ristretto.rb" <[EMAIL PROTECTED]> wrote:
>
> > I leading a project based on Django, and I come from 12 years of Java,
> > and 0 years of Python.  
>
> Well, if you insist : "ha ha ha".
>
> Oh, BTW:http://dirtsimple.org/2004/12/python-is-not-java.html
>
> Ok, done with this. What's next ?-)
>
> > I'm currently digging into the django-trunk on many an occasion,
> > trying to explain things that I can't find in the docs.  Because I
> > don't understand how Django was designed, and can't guess too easily,
> > I find that really slow.
>
> > I'm wondering if getting the KomodoIDE editor with a debugger would
> > make learning Django faster.  Or would WingIDE be a better bet?  Or
> > Eclipse with pyDev.  In theory, I could see stepping through code to
> > learn how it all fits.  But, does this work well in practice?
>
> Note that you don't need any of these "IDE" to step thru the code.
> There's a command line debugger in the standard lib, named pdb. But
> anyway: yeps, stepping thru the code can sometimes help. But if you
> really want to understand Django's inners, that won't be enough IMHO.
>
> > Any other tips to getting up to speed fast?
>
> wrt/ Django's inners ? Some parts really requires solid Python
> knowledge.
>
> The template system should not be to hard to grasp, and the doc on
> custom templatetags etc should get you started for what you really
> need to know.
>
> Someone already pointed you to James Bennett's post on how Django
> handles an HTTP request. But you can browse all other django-related
> posts on James blog, there are tons of things to learn here.
>
> The ORM and newforms part is probably the one with the most "black
> magic", specially if you don't have experience with highly dynamic
> languages - like most Python frameworks, Django makes heavy use of
> Python's dynamism and "advanced" instrospection and metaprogramming
> features, and you'll have to learn about Python's object's model, and
> more specifically:
> - metaclasses
> - descriptors and attribute lookup rules
> - function decorators
> - classmethods / staticmethods
> - generally, use of functions and classes as first-class objects.
>
> Anyway, you'll have to learn about all this to really take advantage
> of what Python has to offer... comp.lang.py is the place for language-
> related questions, and it's mostly a friendly and helpful group.
>
> HTH
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread bruno desthuilliers

On 9 juil, 04:08, "ristretto.rb" <[EMAIL PROTECTED]> wrote:
> I leading a project based on Django, and I come from 12 years of Java,
> and 0 years of Python.  

Well, if you insist : "ha ha ha".

Oh, BTW:
http://dirtsimple.org/2004/12/python-is-not-java.html

Ok, done with this. What's next ?-)

> I'm currently digging into the django-trunk on many an occasion,
> trying to explain things that I can't find in the docs.  Because I
> don't understand how Django was designed, and can't guess too easily,
> I find that really slow.
>
> I'm wondering if getting the KomodoIDE editor with a debugger would
> make learning Django faster.  Or would WingIDE be a better bet?  Or
> Eclipse with pyDev.  In theory, I could see stepping through code to
> learn how it all fits.  But, does this work well in practice?

Note that you don't need any of these "IDE" to step thru the code.
There's a command line debugger in the standard lib, named pdb. But
anyway: yeps, stepping thru the code can sometimes help. But if you
really want to understand Django's inners, that won't be enough IMHO.

> Any other tips to getting up to speed fast?

wrt/ Django's inners ? Some parts really requires solid Python
knowledge.

The template system should not be to hard to grasp, and the doc on
custom templatetags etc should get you started for what you really
need to know.

Someone already pointed you to James Bennett's post on how Django
handles an HTTP request. But you can browse all other django-related
posts on James blog, there are tons of things to learn here.

The ORM and newforms part is probably the one with the most "black
magic", specially if you don't have experience with highly dynamic
languages - like most Python frameworks, Django makes heavy use of
Python's dynamism and "advanced" instrospection and metaprogramming
features, and you'll have to learn about Python's object's model, and
more specifically:
- metaclasses
- descriptors and attribute lookup rules
- function decorators
- classmethods / staticmethods
- generally, use of functions and classes as first-class objects.

Anyway, you'll have to learn about all this to really take advantage
of what Python has to offer... comp.lang.py is the place for language-
related questions, and it's mostly a friendly and helpful group.

HTH
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread [EMAIL PROTECTED]

Wow, I had never heard of pdb before.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread Joshua Jonah
Tim Chase wrote:
>>> Any other tips to getting up to speed fast? 
>>>   
>> With the internal code? I wish there was some silver bullet like that.
>> 
>
> I found James Bennett's page[1] on "How Django processes a 
> request" helpful for understanding the big picture of how the 
> pieces fit together.  It helps makes sense of flow as you wade 
> through the Python source.
>
> Additionally, learning the basics of "pdb"[2] (python's 
> batteries-included debugger) can help as your view can just include
>
>include pdb; pdb.set_trace()
>
> before the line you want to investigate (or even at the top of 
> your view), and the dev-server will pause at that point, allowing 
> you to debug from there.
>
> -tim
>
>
> [1]
> http://www.b-list.org/weblog/2006/jun/13/how-django-processes-request/
>
> [2]
> http://www.google.com/search?q=python%20pdb%20tutorial
>
>
>
> >
>
>   
I found the best resource was djangobook.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread Tim Chase

>> Any other tips to getting up to speed fast? 
> 
> With the internal code? I wish there was some silver bullet like that.

I found James Bennett's page[1] on "How Django processes a 
request" helpful for understanding the big picture of how the 
pieces fit together.  It helps makes sense of flow as you wade 
through the Python source.

Additionally, learning the basics of "pdb"[2] (python's 
batteries-included debugger) can help as your view can just include

   include pdb; pdb.set_trace()

before the line you want to investigate (or even at the top of 
your view), and the dev-server will pause at that point, allowing 
you to debug from there.

-tim


[1]
http://www.b-list.org/weblog/2006/jun/13/how-django-processes-request/

[2]
http://www.google.com/search?q=python%20pdb%20tutorial



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: What is the fastest way to come up to speed with Django?

2008-07-08 Thread ristretto.rb

Hi Malcolm,  Thanks for the reply.

I just spent the day banging through the admin code down to the
oldform fields to track down a problem I was having.  It took a very
long time because I don't know Django under the hood, and I only have
just started to learn Python.

I can think of some features in an IDE that would make this much
easier for me, and no doubt other noobs like myself.  I'll list them
out here in hopes that someone that creates IDE's reads it.  :)

*  go to last edit position (line/file), and keep going back through
history.  Komodo doesn't do this.
*  code completion and inspection in django templates and python
code.  Komodo does this a bit, but it's limited.
*  show """ doc for a object, if available
*  integrated debugger
*  Fast open - type file name to open it


On Jul 9, 2:20 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-07-08 at 19:08 -0700, ristretto.rb wrote:
> > I leading a project based on Django, and I come from 12 years of Java,
> > and 0 years of Python.  
>
> You won't get any crap from me, at least. The more languages people
> know, the better.
>
> > I'm currently digging into the django-trunk on many an occasion,
> > trying to explain things that I can't find in the docs.  Because I
> > don't understand how Django was designed, and can't guess too easily,
> > I find that really slow.
>
> > I'm wondering if getting the KomodoIDE editor with a debugger would
> > make learning Django faster.  Or would WingIDE be a better bet?  Or
> > Eclipse with pyDev.  In theory, I could see stepping through code to
> > learn how it all fits.  But, does this work well in practice?
>
> Personally I have no experience with any of those, so I'm not going to
> give advice.
>
> The one cavaet I'll point out is that *running* pretty much anything in
> Django requires a settings file, since there are a few places where code
> is executed conditionally based on settings. Most files can now be
> imported without a settings file being present (allowing you to import
> things and then manually configure settings in advanced cases), but
> there might be some deep internals where that isn't possible. All this
> means is that you *might* need to have DJANGO_SETTINGS_MODULE set and
> pointing to some reasonably simple settings file (specify a template
> loader and a database engine).
>
> > Any other tips to getting up to speed fast?
>
> With the internal code? I wish there was some silver bullet like that.
>
> When you are poking around the internals, things are generally grouped
> fairly logically. Although, like any piece of software with five or six
> years of development behind it, there are some historical oddities as
> well. But, by and large, you'll find like grouped with like. For
> example,
>
>         django/templates:
>                 all the template loading and rendering code
>         django/core/handlers:
>                 the stuff that is the outer layer of request/response
>                 handling.
>         django/db/models/fields/
>                 all the model field code
>         django/db/models/sql
>                 SQL statement creation
>         django/db/models/*
>                 all the other model stuff
>         django/db/backends/
>                 the individual database backends and common wrapping
>                 code for them.
>         django/utils/translation/
>                 i18n/l10n support
>
> django/utils is a bit of a grab bag of internal common stuff that is
> used in multiple places. Django/core is stuff that didn't sit anywhere
> else but was important.
>
> In something as modular and wide-ranging as Django there isn't really an
> obvious way to read it from beginning to end. However, if you really
> want to understand what's going on you could start with the lifecycle of
> an HTTP request (django/core/handlers/wsgi.py, say), which leads to URL
> resolving, following through to the middleware, view calling, middleware
> again and response dispatching. Orthogonal to that is model handling,
> database interaction (triggered by the model code) and various view
> support stuff like generic views.
>
> Regards,
> Malcolm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: What is the fastest way to come up to speed with Django?

2008-07-08 Thread Malcolm Tredinnick


On Tue, 2008-07-08 at 19:08 -0700, ristretto.rb wrote:
> I leading a project based on Django, and I come from 12 years of Java,
> and 0 years of Python.  

You won't get any crap from me, at least. The more languages people
know, the better.

> I'm currently digging into the django-trunk on many an occasion,
> trying to explain things that I can't find in the docs.  Because I
> don't understand how Django was designed, and can't guess too easily,
> I find that really slow.
> 
> I'm wondering if getting the KomodoIDE editor with a debugger would
> make learning Django faster.  Or would WingIDE be a better bet?  Or
> Eclipse with pyDev.  In theory, I could see stepping through code to
> learn how it all fits.  But, does this work well in practice?

Personally I have no experience with any of those, so I'm not going to
give advice.

The one cavaet I'll point out is that *running* pretty much anything in
Django requires a settings file, since there are a few places where code
is executed conditionally based on settings. Most files can now be
imported without a settings file being present (allowing you to import
things and then manually configure settings in advanced cases), but
there might be some deep internals where that isn't possible. All this
means is that you *might* need to have DJANGO_SETTINGS_MODULE set and
pointing to some reasonably simple settings file (specify a template
loader and a database engine).

> Any other tips to getting up to speed fast? 

With the internal code? I wish there was some silver bullet like that.

When you are poking around the internals, things are generally grouped
fairly logically. Although, like any piece of software with five or six
years of development behind it, there are some historical oddities as
well. But, by and large, you'll find like grouped with like. For
example,

django/templates:
all the template loading and rendering code
django/core/handlers:
the stuff that is the outer layer of request/response
handling.
django/db/models/fields/
all the model field code
django/db/models/sql
SQL statement creation
django/db/models/*
all the other model stuff
django/db/backends/
the individual database backends and common wrapping
code for them.
django/utils/translation/
i18n/l10n support

django/utils is a bit of a grab bag of internal common stuff that is
used in multiple places. Django/core is stuff that didn't sit anywhere
else but was important.

In something as modular and wide-ranging as Django there isn't really an
obvious way to read it from beginning to end. However, if you really
want to understand what's going on you could start with the lifecycle of
an HTTP request (django/core/handlers/wsgi.py, say), which leads to URL
resolving, following through to the middleware, view calling, middleware
again and response dispatching. Orthogonal to that is model handling,
database interaction (triggered by the model code) and various view
support stuff like generic views.

Regards,
Malcolm



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



What is the fastest way to come up to speed with Django?

2008-07-08 Thread ristretto.rb

I leading a project based on Django, and I come from 12 years of Java,
and 0 years of Python.  

I'm currently digging into the django-trunk on many an occasion,
trying to explain things that I can't find in the docs.  Because I
don't understand how Django was designed, and can't guess too easily,
I find that really slow.

I'm wondering if getting the KomodoIDE editor with a debugger would
make learning Django faster.  Or would WingIDE be a better bet?  Or
Eclipse with pyDev.  In theory, I could see stepping through code to
learn how it all fits.  But, does this work well in practice?

Any other tips to getting up to speed fast?  I have both Django books,
2 python references and the python cookbook, and I'm working hard to
get up to speed.

thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---