Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming The Internet IT Technology

Django: Python's Rapid Web Development Framework 75

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..."
This discussion has been archived. No new comments can be posted.

Django: Python's Rapid Web Development Framework

Comments Filter:
  • Ok, and perl has catalyst [perl.com] coming. Now everybodies pet languages have their own rapid development web platform. Can we move on now?
  • *shakes head* (Score:2, Insightful)

    by Anonymous Coward
    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 anony
    • if i remember correctly (i think i do at least) python has the 'lambda' function which can be used anonomously?
      • Indeed. But LISP'ers will be quick to remind you it's nothing to be proud of, they've had it forever by accident.
    • Re:*shakes head* (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 [sourceforge.net].

    • Tcl:

      1) Is a very easy language to learn, so it can be used in the templates as well as the backend.

      2) Has lots of nifty introspection features, so you can do quite fancy programming if you care to - since the syntax is so simple, you can even write new control structures in Tcl itself.

      3) Tcl is sort of a pragmatic Lisp: http://philip.greenspun.com/tcl/ [greenspun.com]

      Unfortunately, we don't have the fancy web framework in place just yet, but I think Tcl is still one of the best languages out there for web coding.
      • Please. Not Tcl. It's ugly. It's even slower than Ruby. Has bizarre scoping rules (upvar, global, interp - just try chasing variables around in a moderately complex Tcl script where these are all used liberally). OO tacked on as an ofterthought.

        I haven't done a lot of Tcl, but when I have had to work on Tcl code over the years it's been exceedingly painful.

        Tcl was great in it's day (1989), but now Tcl is tired and needs rest.
        • Which version(s) of Tcl do you believe to be slow? Which software were you running on top of the language core? Griping about stuff on /. is all very well, but actually saying "This specific X is too slow" allows it to be fixed.

          On the "ugly" comment, I'll just say "each to his own". I don't care for Ruby or Python all that much myself, but I learnt long ago that people's mileage really does vary.
      • by dkf ( 304284 )
        Unfortunately, we don't have the fancy web framework in place just yet...

        Ah, so OpenACS [openacs.org] isn't a fancy web framework?
    • by ultrabot ( 200914 )
      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 anonymou
      • Example? In fact ruby is more verbose than Python in some ways, because of the need for block delimiters.

        Python has block delimiters too. They prefix every single line. Just because you can't see them printed doesn't mean they're not there. Just try leaving them out.

        I can deal with the indentation syntax, I in fact write and maintain quite a bit of code in python. I also used to work on Infoseek pages way back, and I can tell you that I cannot deal with the indentation syntax when code is embedded into
      • anonymous function are there, (lambda x: x*x)

        Can you have more than one expression in a Python lambda? Didn't think so.

        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.

        Hey, why not get rid of (or make optional) that indentation-as-block-delimiter thingy in 2.5 too, then it'll be even more like Ruby.

        Ruby is flattered that the 'with' statement is being added to Python in an effort to make it more
        • Can you have more than one expression in a Python lambda? Didn't think so.

          No, but then you can just do

          def L(x):
          print x
          return x+1

          doStuff(L)

          Using the letter "L" doesn't hurt anyone.

          Ruby is flattered that the 'with' statement is being added to Python in an effort to make it more Ruby-like, but from what I've seen it still doesn't have the power of Ruby's blocks.

          It covers the cases where the blocks are mostly used, that are not already covered by generators.
    • I'm sure that Rails is spiffy 'n all, but I'd rather use a language that I'm already familiar with.

      I realise at that point all the hacks will crawl out of the woodwork and tell me that any programmer worth his salt can pick up a language in no time, but that's not really true. Yes, any decent programmer should be able to get started with another language very quickly, but it takes some time to get used to the standard library that comes with a new language and it takes time and experience to get a handle on
      • What's nice about Rails is how little code you actually write. It makes it easier to pick up Ruby gradually that way. If you know perl, ruby won't take you long. Learning some of Ruby's odd idioms might take longer, but you aren't forced to use 'em.

        Ruby has poor unicode support however, which makes it a non-starter for my current application (which has to deal with data in UTF-8 that's often in Russian, Chinese, and Korean just to name a few).
      • I'm sure that Rails is spiffy 'n all, but I'd rather use a language that I'm already familiar with.

        I am so tired of this complaint. Keep up or ship out. If you're going to compete with other languages, you need to know what they can and cannot do. That means you have to learn them. This is not time wasted. This is time invested in your ability as a programmer. You are getting "something done." You are training yourself. At the rate that our industry evolves, if you don't train yourself, you'll become u

        • I think his point is that while Ruby is nice and all it doesn't seem to offer that much more than eg Python. They are both scripting languages. And while Ruby on Rails is good for hacking together a simple WWW site it may not pay off to learn the language just to solve a one off problem. In that case you'd be better off solving it in a language you know.

          So I think you are overthinking this "problem" waaaaay too much. Besides I'm quite convinced that someone who uses Python is already competent in multiple l
          • I think his point is that while Ruby is nice and all it doesn't seem to offer that much more than eg Python.

            Non-trivial lambdas is a big deal. Python doesn't offer it. Ruby does. I'm not sure why python doesn't offer it, but it doesn't and even with this new "with" stuff, it's not going to.

            And while Ruby on Rails is good for hacking together a simple WWW site it may not pay off to learn the language just to solve a one off problem. In that case you'd be better off solving it in a language you know.

            • This is why the other poster's reluctance to learn Ruby troubles me. After you learn 4 or 5 lanuages, it starts to become easy.

              To be fair I did explain that. Perhaps I simply don't have a particularly good memory, but I find that it's not the learning of the language that's tricky - the basics of a language can be picked up very quickly - it's the remembering all the standard library stuff that takes time. Starting with a new language I seem to spend a lot of my time flicking through the reference manuals

        • It wasn't a complaint.

          You were saying that we shouldn't use [insert own language preference here] Rails-alike and should instead try Rails first.

          I was saying that actually, I'd rather just stick with the one in my preferred language, as I'll be able to get going more quickly.

          Now I'm not really sure what you're trying to say now. That I should try every new language I see? I have looked at Ruby, but to be honest if I was to devote some time to learning a new language I'd probably want to go with something a
          • You were saying that we shouldn't use [insert own language preference here] Rails-alike and should instead try Rails first ... I was saying that actually, I'd rather just stick with the one in my preferred language, as I'll be able to get going more quick.

            People have gone from 0 ruby skill to major Rails contributor or Rails consultant in less than 2 months in some cases. Ruby is a very easy language to learn, and its standard library is designed around the concept of doing what you expect. Considering

            • Well, if Rails really is so much better than Django as you suggest, then perhaps it is worth looking at Rails instead. If it's only a little bit better though, I'd still be tempted to go with Django.

              Nevertheless, all your points are good.

              ...but one of the most important attributes of a programmer, in my humble opinion, in is the willingness and even excitement for learning.

              That's true, but there's more to learn than just languages. I've got interesting enough things to look at right now without another ne

    • Anything in Perl or PHP is right out.

      Yeah, because that would be way too mainstream. Explain to me why every article has to have some holier than thou asshat slamming PHP for being good at one thing. Can I ask - is there some exclusive club you got a card to when you dissed PHP?

      There are many bad PHP programmers out there, and that has led to tons of sloppy code, but that doesn't mean the language as a whole sucks. How about some REASONS, other than the fact that it's not as 1337 when you're writing in t
      • Oh PHP, how do I hate thee, let me count the ways:

        1. Namespace. Everything in one big global namespace of functions.

        2. Consistency. Grossly inconsistent function naming scheme. Sometimes it's noun_verb, sometimes it's verb_noun, sometimes there's an underscore, sometimes there isn't, sometimes it changes these conventions within the same module. Making matters worse are about a dozen different ways to compare and match strings, typically a different one for case-insensitive or not. I guess that's the o
    • PHP is a joke and can be dismissed without further discussion.

      Ok, I'm not responding just because I use PHP in my day-to-day job and for my personal web programming. PHP is not an application development language, it's a scripting language!

      PHP, Python, C++, Ruby, etc. They all have their place and their function. Citing Ruby as superior to Python (or vice versa) is kind of like saying my kid is better than your kid because he can juggle and yours can't. To which you respond, 'yeah, well mine can ride a un

    • Re:*shakes head* (Score:2, Informative)

      by holovaty ( 678950 )
      > 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 t
    • doesn't allow you to use Python in the HTML statements

      if you are embedding language statements in your HTML, you have made the egregious mistake of combining rendered content and logic (ala PHP).

      however, any decent templating language, including Django's, will allow you to embed language expressions in your HTML.
    • Don't be afraid of Ruby
      Well I tried to install with the ruby on rails one-click installer, just to see what all the dang hype is about, and the OnLamp [onlamp.com] instructions fail at the gem step.

      If you must know, it claims:
      ERROR: While executing gem ... (Gem::RemoteSourceException) Error fetching remote gem cache: getaddrinfo: no address associated with hostname.

      I guess Ruby isn't quite done yet. Although to be fair, it took about a day and a half to install Microsoft Visual Studio.

  • Catchy, no?
  • The {{ }} syntax is quite readable. I've been waiting for a decent Python template engine to jump on and migrate away from Java. Don't mind a performance hit when I get easier to read code that has a shorter iterative development cycle.

    Waiting for WebLogic to compile a JSP is way too painful and having to write strait in Servlet is troublesome as well. Aside from going to Velociy templates, This looks very sweet indeed.

    Nice to also have native JSON interpretation in the language to aid client (JavaScript) t
    • Don't mind a performance hit when I get easier to read code that has a shorter iterative development cycle.

      Most people do mind a performance hit, and will go out of the way (read: more work on the code) to avoid it.

      • 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, maybe the first optimization is the programming language + framework you choose...
        • Re:Very clean syntax (Score:3, Informative)

          by Nasarius ( 593729 )
          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.

      • I saw Woz surfing PORN on the Woz Cam [woz.org], now it's disabled!

        And you didn't take a screenshot?
    • Just out of curiosity, have you actually tried Rails? If you care about concise and easy to read code, Ruby+Rails seems a better option than Python+Django to me. At least I find Ruby to be cleaner than Python, and Rails code often seems about as concise as it gets.
      • The reasons I have avoided Ruby has many tails:

        1) It was difficult enough for me to convince my bosses to install a Python interpreter on our production servers.

        2) Python has very good bridging support with libraries for binding to Objective-C and Java. Since multi-language apps is where I want to go for my larger hacks this is important.

        3) Python has been around longer, has a larger user base and has tons of libraries and apps out there. Ruby is still quite young and will take more time to gather more lib
    • Haven't you've tried Zope Page Templates? They have a few implementations outside of zope, if for any reason you don't like that.

      On the other hand, I don't know much about Rails, but Why not zope? Rapid development, a lot of suport, open source, has comercial backing, and you also get plone or CPS. Extra goodies! You don't need to mess with SQL, has catalog search features, users and rights, ZPT (which are absolutely beautiful, IMHO), workflow, security, "disk" based development, through the web development
  • by baldass_newbie ( 136609 ) on Monday August 01, 2005 @10:00PM (#13219292) Homepage Journal
    The Django ate my baby.

  • "... he and his colleagues are releasing into the wild."

    Software developers need marketing skills. It's not a good idea to call your prospective users "the wild".
  • Nitro [nitrohq.com]; another Ruby web framework which seems stronger than Rails in some areas.

    Mmmmm, so much choice.
  • I'm currently half-assedly developing a similar deal for PHP, but it lacks a lot of the features of Django. Anyone know of a PHP equivalent? Don't say Prado or whatever it was that won the PHP Coding contest or whatever recently, that seems to me like killing an ant with a nuclear warhead

"There are things that are so serious that you can only joke about them" - Heisenberg

Working...