Slashdot Mirror


Django: Python's Rapid Web Development Framework

ucahg writes "Simon Willison has a post on his blog introducing Django, a rapid web development framework he and his colleagues are releasing into the wild. Hailed as Python's own version of a Rails framework, Django looks very promising. I'll be keeping a close eye on it as it gets more and more support..."

6 of 75 comments (clear)

  1. *shakes head* by Anonymous Coward · · Score: 2, Insightful

    Okay, great.

    Now when people talk about Rails you can say "ha ha, I'm better, I use DJANGO!" Or Subway, Maypole, Catalyst, Cake, or Trax, or whatever.

    I've tried about half of those and none are *quite* as smooth as Rails. Anything in Perl or PHP is right out. Perl can do everything Ruby can, but with syntax that makes you want to poke your eyes out. PHP is a joke and can be dismissed without further discussion. Python is more verbose than Ruby, doesn't allow the same metaprogramming (closed classes! no anonymous functions!), doesn't allow you to use Python in the HTML templates, because Python is white-space dependent (okay, some people disagree about that last one, but I personally think the same language should be used in the templates).

    Is Rails perfect? Hells to the no, Ruby is about as fast as a constipated 80-year old, and doesn't support Unicode, but if you want to talk ease of programming, Ruby is at the top IMO. Except maybe for maybe lisp or smalltalk but Ruby is a lot more pragmatic.

    I don't mind people reinventing the wheel over and over again but whenever you see people saying "Language X's answer to Rails" all the time, you gotta be thinking to yourself, wow, maybe I should try Rails FIRST and then try the knock-offs. Don't be afraid of Ruby!

    1. Re:*shakes head* by Fess_Longhair · · Score: 2, Interesting
      Python ... doesn't allow you to use Python in the HTML templates, because Python is white-space dependent (okay, some people disagree about that last one, but I personally think the same language should be used in the templates).

      Me too. That's why I use spyce.

    2. Re:*shakes head* by holovaty · · Score: 2, Informative

      > I don't mind people reinventing the wheel over
      > and over again but whenever you see people saying
      > "Language X's answer to Rails" all the time, you
      > gotta be thinking to yourself, wow, maybe I
      > should try Rails FIRST and then try the
      > knock-offs.

      Disclaimer: I'm one of the two core developers of Django.

      Django isn't a reinvention of the wheel or "copycat" of Ruby on Rails. We wrote it about two years ago for production use at the newspaper Web site I work for and have been using it since then. (I believe Rails was released one year ago.) It's a framework that was derived from our production sites.

      Frankly, it's not intended to be an "answer" to Rails, and I'm disappointed (but not surprised) it's being talked-about as such. Rails and Django solve different problems. Django is more suited for content-management, because it gives you a lot of content-management capability for free.

  2. Can I be the first to say... by baldass_newbie · · Score: 3, Funny

    The Django ate my baby.

    --
    The opposite of progress is congress
  3. Re:Very clean syntax by Nasarius · · Score: 2, Informative
    don't mean to flame, but this is one of the reasons why there is so much buggy / useless software out there.

    as they say, premature optimization is the root of all evil

    Precisely. One of the cool things about Python is that you can write your app with it, run it through a profiler, and rewrite the bottlenecks in C/C++ if you really need to.

    --
    LOAD "SIG",8,1
  4. Dispelling some myths by ultrabot · · Score: 2, Informative

    Python is more verbose than Ruby,

    Example? In fact ruby is more verbose than Python in some ways, because of the need for block delimiters.

    doesn't allow the same metaprogramming (closed classes! no anonymous functions!)

    The classes are not closed, you can add methods and attributes to classes after declaration (classes are mutable objects). It's just that there is no direct syntactic support, which is not a big problem because normal user code (as opposed to framework code) doesn't need to do it.

    And anonymous function are there, (lambda x: x*x), and it's not a problem to give function a temporary name because the names can be reused.

    As for blocks (which you didn't mention, surprisingly), python 2.5 is going to have a "with" statement that does mostly the same thing blocks in ruby are used for.

    doesn't allow you to use Python in the HTML templates

    Come on, there way too *many* templating systems for Python.

    --
    Save your wrists today - switch to Dvorak