2009年5月31日星期日

One Laptop Battery Later And I'm A Django Fan

One Laptop Battery Later And I'm A Django Fan

I haven’t had much time to do any coding since I’ve been studying music full time, and I’m taking these two weeks to work on all the pent up projects and work I’ve been ignoring. One of those projects is to finally try out Django tonight. I’d been avoiding it because I didn’t want to Hp laptop battery,get sucked into yet another web application framework I didn’t need, but after spending one laptop battery going through the tutorial I just got one thing to say:


Django Fucking Rocks

Now, I know that when I drop the f-bombs and do crazy shit like disagree with people they get their panties in a bunch and call it trolling. Calling disagreement trolling is kind of the inverse of Godwin’s law but I simply gotta throw the passion in there and say it FUCKING rocks.


However, I’m about to qualify this sentiment with the reasons why, based on my experience as a web developer for nearly every industry that uses software, Django is truly good stuff. Most of my review of Django so far is based on this experience, and it in noF4098A, way states that your framework isn’t also good.


As you read this, turn off the binary bit for a minute and realize that I’m going to tell you what I like about Django so far, not how Django is better than your framework.


Got the bit turned off? You sure, 'cause I don’t want to get emails debating me that start with your framework also does this stuff. That’s nice, but not what I’m talking about. What I’m talking about is what I like about Django.


And now, in order of how I encountered them, the top 10 things I like about Django.


#1) The Documentation

The Django Documentation is pretty damn good so far. I think modern web F4809A, frameworks generally have good free documentation, but so far Django’s has been very easy to follow, attractive, and dead accurate. I’m sure I’ll run into errors here and there, but when I get comments like this from the community:


[ubernostrum] zedas: one thing that’s not so well-documented, actually is the admin.

I know that the people doing the documentation care enough to take changes, patches, and feedback.


Currently I’ve read the Overview, Installation, Tutorial and about 1/3 of the Django Book 2.0 and I’ve browsed many random topics like signals which look very useful.


Based on this review of the documentation, I can say that I haven’t hit any major errors, problems with clarity, or problems finding anything.


#2) The Community

I just gotta say Python people are pretty nice. Sure, geek communities everywhere are full of weird people, and I guess that’s why I get along with them so well. But in the Python world, I’m probably the meanest guy they know.


What’s more important though is they started helping right away. I was on the #django channel on irc.freenode.org and just mentioned that I was learning Django. Now, I didn’t actually ask for help, since I’ve been doing this long enough to figure this stuff out fairly quick, but people started pointing meF4812A, at better docs without me asking.


It’s refreshing to run into a group who’s attitude is, “Oh, newbie, ok read this and that and that, and oh that too but watch out for…”


#3) The Admin

For those of you who don’t know, Django has this cool feature called The Admin which uses your object model and the components you’ve installed in your site to provide you with a fully functioning admin console. With this you can create sites, alter objects, list, delete, sort, filter, drill down, make tables, everything you do in 90% of all enterprise applications.


Going through the admin, and how easily you can make your own modifications, I just feel angry because I’ve had to write that same dumb “sortable-table-of-objects-with-drill-down-filters” over and over and over. Each time in a different framework with a different language. I look at the “log of things you’ve done” 11-001319411-001to the right and cry. I’ve had to implement that over and over. Each time it was “always way different from the last time” and then it was just exactly what Django has staring at me and mocking me.


I say, if you’re doing the typical enterprise bullshit coding that’s nothing more than a ton of tables with sorting, you should seriously be trying out the Django Admin. Even if all you do is use it as a way to get a prototype in front of users for initial feedback and discovery it will still save you mountains of work later.


#4) The Admin Docs

Once you install docutils this wonderful world opens up where gnomes run around singing and telling you naughty little secrets about your application. With that one skeleton key, your Django Admin will actually let you drill into all your models and views to see their structure. No more dumping SQL databases to find out the name of that damn table for the Person class and whether there’s a VARCHAR on it causing you problems.


Instead you just hop over to the console and browse around. sario 2100(compaq 2100),Take a look, see what the models are doing, glance at the views. Forget the template syntax? It’s there. Forgot what URL to use for the user view? It’s there. Need to know all the tags? Yep, all there.


#5) The Conferences

As I work on this little poll application in the tutorial, I remember that I’m going to Prague for EuroDjangoCon 2009 to give a keynote. I’ve been to many conferences, with last year being the most I’ve ever done, but this conference season I only have time for one. How could I pass up such a cool list of speakers, nice group of people, and a visit to Prague?


When I think of the Python conferences I’ve been to, I’ve liked all of them quite a lot. They are rarely heavily commercial, usually very cheap, and have a much more laid back community feel to them.


The coolest thing though is meeting John Draper at PyCon. Not sure why he was there, but that was pretty cool.


#6) The Modularity

I mostly ignored Django for most of its life because I thought it was just another web framework. Yawn. Yay. Presario 2500(compaq 2500 battery), A framework. Joy. Models. Views. Controllers. Oh boy, I think I’ll just stick to one of the hundreds I already know.


Then I saw James Tauber talking about Pinax but more importantly, talking about how 2008 was the year of modularity (he used different words). Apparently, Django has been pushing the idea of having discrete “applications” that act within a “site” as cooperating but separate components.


The idea is that, unlike other “components”, these ones act like decoupled little web sites you can put in and configure for a site, and through the magic of HTTP work seamlessly. From this you can have fully packaged applications that implement functionality you need, like authentication, or caching, or tribes without having to gut your whole application and muck around in code.


If that particular component isn’t working well for you, then you can just modify it, or write your own. Since it’s loosely coupled, and you hopefully kept it that way, then the change isn’t too painful.


This change in the architecture Presario NX9010, of a site from “the site is the application” to the “site has many small applications” is powerful to me. I know other frameworks tried similar things, but since they tried to implement their plugin/module systems through code rather than web plumbing it tends to be more brittle.


Obviously, this can’t be all roses, as I’m sure anyone who’s tried to use Django apps will say, but the fact that there’s a concerted and coordinated effort to make it a central part of Django means your burns will be only 1st degree.


#7) The Simplicity

At first, I was pretty worried when going through the tutorial because it had me returning HttpResponse objects in the buff with no help. As I went through it though they corrected this, and it turned out that much of the code I was writing (or just pasting, 'cause I’m lazy) was very small for a lot of work done. Presario NX9000Each paragraph of the tutorial made the code for a generic CRUD application smaller and smaller until they showed generic views eliminating most of it.


 

没有评论:

发表评论