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..."
What's old is new again (Score:2)
Re:for the grammer nazi's (Score:1)
Reminds me of a Post-It I saw on a co-worker's desk: "Remember to check spelling and grammer."
Re:for the grammer nazi's (Score:2)
That said, how do you pronounce "grammar"? My spelling "mistake" (languages evolve, right?) is due to my spelling it as I say it.
Anyway, either I spelled it wrong, or I was referring to nazis from grammer, IN.
Re:for the grammer nazi's (Score:2)
*shakes head* (Score:2, Insightful)
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
Re:*shakes head* (Score:1)
Re:*shakes head* (Score:2)
Re:*shakes head* (Score:2)
So you would agree that Python has anonymous functions, then?
Well, in the strictest meaning of function, then yes. Lambdas don't contain a block of code to executed (like in named functions), they can only contain an expression to evaluate. Python is sufficiently functional programmingish to make that somewhat valuable, but anonymous functions aren't the same things as named functions.
Re:*shakes head* (Score:2)
Re:*shakes head* (Score:2)
Re:*shakes head* (Score:2)
Re:*shakes head* (Score:2)
Re:*shakes head* (Score:2, Interesting)
Me too. That's why I use spyce [sourceforge.net].
Tcl (Score:2)
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.
Tcl is tired (Score:2)
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.
Re:Tcl is tired (Score:2)
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.
Re:Tcl (Score:2)
Ah, so OpenACS [openacs.org] isn't a fancy web framework?
Re:*shakes head* (Score:2)
If you compare the standard libraries that are built into python with those in Lisp, you'll notice a huge difference. Python comes
Dispelling some myths (Score:3, Informative)
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
Re:Dispelling some myths (Score:2)
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
Re:Dispelling some myths (Score:2)
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
Re:Dispelling some myths (Score:2)
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.
Because it's Python? (Score:2)
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
Re:Because it's Python? (Score:2)
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).
Re:Because it's Python? (Score:2)
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
Re:Because it's Python? (Score:2)
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
Re:Because it's Python? (Score:2)
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.
Re:Because it's Python? (Score:2)
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
Re:Because it's Python? (Score:2)
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
Re:Because it's Python? (Score:2)
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
Re:Because it's Python? (Score:2)
Nevertheless, all your points are good.
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
Re:*shakes head* (Score:2)
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
Re:*shakes head* (Score:2)
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
Re:*shakes head* (Score:2)
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)
> 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
MOD PARENT UP (Score:2)
Sorry that I don't have any real mod points to use at the moment.
Re:*shakes head* (Score:1)
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.
Re:*shakes head* (Score:1)
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: ... (Gem::RemoteSourceException)
Error fetching remote gem cache: getaddrinfo: no address associated with hostname.
ERROR: While executing gem
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.
Django Fever!!! (Score:1)
Very clean syntax (Score:2)
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
Re:Very clean syntax (Score:2)
Most people do mind a performance hit, and will go out of the way (read: more work on the code) to avoid it.
Re:Very clean syntax (Score:2)
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)
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.
Re:Very clean syntax (Score:2)
And you didn't take a screenshot?
Re:Very clean syntax (Score:2)
Re:Very clean syntax (Score:2)
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
Re:Very clean syntax (Score:2)
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
Can I be the first to say... (Score:3, Funny)
Re:Can I be the first to say... (Score:1)
Re:django hopes (Score:1)
Their mysteries are written in UTF-8, but they're trying to decode them in ISO-8859-1.
Thats why they often get confused.
Re:django hopes (Score:1)
I'm not "the wild". Are you? (Score:2)
"... 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".
Re:I'm not "the wild". Are you? (Score:1)
Just the way these application platforms work.
Re:I'm not "the wild". Are you? (Score:1)
Re:I'm not "the wild". Are you? (Score:2)
Seriously the headline said it would be released into the wild.
If you were the wild like you say, then I'd be worried about them coming to release something into you. You only got a few holes and only one is for input of solids.
Re:I'm not "the wild". Are you? (Score:1)
Naw, we outsource our marketing to the Philippaens.
Another one (Score:2)
Mmmmm, so much choice.
PHP equivalent (Score:1)