Re: Django, or, Why I upgraded my Linux server
Message Details
Posted
2/24/2007; 10:40 PM by Greg PierceLast Modified
2/24/2007; 10:40 PM by Greg PierceIn Response To
Django, or, Why I upgraded my Linux server (#7641)Label
None.Read Count
2335
Message Body
On Feb 24, 2007, at 6:56 PM, Jim Roepcke wrote:
> I want to try out Django <http://www.djangoproject.com/>, a new
> Python-based web development framework. Unfortunately, getting its
> dependencies installed on Mac OS X is a massive pain...
Um, not sure about that. I setup and was running Django on my
MacBook in about 15 minutes. I did already have a current version of
MacPython installed, but otherwise nothing special. I haven't pushed
it though any heavy paces, so maybe I'm missing something, but it's
working.
> From what I can tell, with Rails, once you've got your (data) model
> set up, you might as well be doing PHP development.
Mind you, I do like Rails, but I don't consider myself a platform
bigot on any case. This is interesting to me because I just spent
the whole day immersed in Django on Thursday in the lead up tutorial
day before PyCon. So I've been thinking about the pros and cons of
each.
I think you are not connecting somewhere with Rails if you think that
way about it, however.
> Rails' template/component systems are pure torture.
If you're even looking at "components" in Rails, you shouldn't. It's
a deprecated technology that was a mis-fire to begin with.
Django's templates are really much less powerful than Rails'
ERB...and other builder options. Particularly plugins like Markaby.
Django's are also somewhat backwards to me, the the block definition/
inheritance approach.
That said, you can use other python template engines with Django.
As far as ASP/JSP/PHP -- I'm a little lost. Django and Rails both
have a template engine that lets you put code in delimited areas like
ASP/JSP/PHP, but both discourage you from putting functional code
there. Can you? Yes, but it would be bad design in Rails, which is
fully MVC -- Django isn't, and doesn't have a real "controller"
layer, and embeds more presentation logic in the model layer and
expects your templates to rely on that.
> I have it on good authority that Django should suit my tastes
> better, and I hope that's the case! Worst case, my Linux server is
> now up to date and I now know how to build deb packages from
> source. :-)
Django's big plus is the auto-generated admin interface with built-in
security, which makes it very well suited to rapid development of CMS
type applications where you are pushing out public content controlled
by small number of administrative users. It has less developed
presentation layer tools -- like no integrated AJAX framework or form
building tools. If you have an application that requires end-users
do a lot of interaction with the datasets, you'll have a lot more
work in Django than you would in Rails.
Django's Model layer mixes presentation and data rather broadly.
This enables the automatic admin features, by allowing you set
attributes about your fields at that layer.
Rails is more pure MVC approach. ActiveRecord is a well developed
and flexible ORM layer that encourages good separation of the
presentation and model data. It's based more on introspection of
your database, and has more long term maintainability built in using
Migrations. Django doesn't support these type of features right
now. If you run "syncdb" in Django, it's essential a drop the db and
start over sort of operation.
Rails also has good testing integration at all levels, which there is
no explicit support for in Django. Rails also has good deployment
tools, like capistrano.
All that said, Django is very cool -- if you're application fits in
their forte for CMS type sites. If you're getting out of that realm,
I think you'd find Rails more flexible and powerful.
If you want a more pluggable, flexible alternative to Rails in the
Python community, you might look at TurboGears, also.
There's a lot more points that could be made for each, I'm sure. But
those are my thoughts at the moment.
g.
On Feb 24, 2007, at 6:56 PM, Jim Roepcke wrote:
> I want to try out Django <http://www.djangoproject.com/>, a new
> Python-based web development framework. Unfortunately, getting its
> dependencies installed on Mac OS X is a massive pain...
Um, not sure about that. I setup and was running Django on my
MacBook in about 15 minutes. I did already have a current version of
MacPython installed, but otherwise nothing special. I haven't pushed
it though any heavy paces, so maybe I'm missing something, but it's
working.
> From what I can tell, with Rails, once you've got your (data) model
> set up, you might as well be doing PHP development.
Mind you, I do like Rails, but I don't consider myself a platform
bigot on any case. This is interesting to me because I just spent
the whole day immersed in Django on Thursday in the lead up tutorial
day before PyCon. So I've been thinking about the pros and cons of
each.
I think you are not connecting somewhere with Rails if you think that
way about it, however.
> Rails' template/component systems are pure torture.
If you're even looking at "components" in Rails, you shouldn't. It's
a deprecated technology that was a mis-fire to begin with.
Django's templates are really much less powerful than Rails'
ERB...and other builder options. Particularly plugins like Markaby.
Django's are also somewhat backwards to me, the the block definition/
inheritance approach.
That said, you can use other python template engines with Django.
As far as ASP/JSP/PHP -- I'm a little lost. Django and Rails both
have a template engine that lets you put code in delimited areas like
ASP/JSP/PHP, but both discourage you from putting functional code
there. Can you? Yes, but it would be bad design in Rails, which is
fully MVC -- Django isn't, and doesn't have a real "controller"
layer, and embeds more presentation logic in the model layer and
expects your templates to rely on that.
> I have it on good authority that Django should suit my tastes
> better, and I hope that's the case! Worst case, my Linux server is
> now up to date and I now know how to build deb packages from
> source. :-)
Django's big plus is the auto-generated admin interface with built-in
security, which makes it very well suited to rapid development of CMS
type applications where you are pushing out public content controlled
by small number of administrative users. It has less developed
presentation layer tools -- like no integrated AJAX framework or form
building tools. If you have an application that requires end-users
do a lot of interaction with the datasets, you'll have a lot more
work in Django than you would in Rails.
Django's Model layer mixes presentation and data rather broadly.
This enables the automatic admin features, by allowing you set
attributes about your fields at that layer.
Rails is more pure MVC approach. ActiveRecord is a well developed
and flexible ORM layer that encourages good separation of the
presentation and model data. It's based more on introspection of
your database, and has more long term maintainability built in using
Migrations. Django doesn't support these type of features right
now. If you run "syncdb" in Django, it's essential a drop the db and
start over sort of operation.
Rails also has good testing integration at all levels, which there is
no explicit support for in Django. Rails also has good deployment
tools, like capistrano.
All that said, Django is very cool -- if you're application fits in
their forte for CMS type sites. If you're getting out of that realm,
I think you'd find Rails more flexible and powerful.
If you want a more pluggable, flexible alternative to Rails in the
Python community, you might look at TurboGears, also.
There's a lot more points that could be made for each, I'm sure. But
those are my thoughts at the moment.
g.
Replies
| Re: Django, or, Why I upgraded my Linux server ( 2/25/2007 by Jim Roepcke ) | |
| On 24-Feb-07, at 7:40 PM, Greg Pierce wrote: > On Feb 24, 2007, at 6:56 PM, |




