Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Django admin now ships JQuery (djangoproject.com)
55 points by ericholscher on Jan 26, 2010 | hide | past | favorite | 20 comments


Thank god they finally went for the sensible option. It would have been highly irritating if it was rejected as an unnecessary dependency (which some people were arguing).


I know it is not the case but this will reflect to most that JQuery is the toolkit of choice for Django.


It's certainly convenient.

But the Django admin is only an optional application. Your apps may use whatever makes sense for them


It's not like it's going to be advertised on the front page of djangoproject.com, I'd imagine devs wouldn't even know about it unless you were reading up on how to customize the admin UI.


Well, I'm happily surprised.


The arm finally got bent I guess. This has been brought up quite a few times in the last few years on the Django dev list as I recall. Argument was always around the fact that some commiters didn't want to commit the Django components to any specific JavaScript framework.


Using jQuery in the (optional) admin tool doesn't commit the framework to jQuery. The view and template mechanisms remain blissfully JavaScript toolkit agnostic. I happen to use jQuery with Django, but appreciate the neutrality.


Wasn't Django built so you could drop in jquery and it would pick it up and use it for the admin? So it was optional. I could be making that up.


Nope - Django has never had this ability.


That's an interesting point. So what's the counterargument?


That django-admin is a discrete application. Django itself, and thus your app, remains resolutely uncommitted to one particular JS framework.


Rolling your own is silly and counter productive. Something needed to be chosen, and JQuery is the obvious choice.

Totally pragmatic.


I agree. I think it was good decision as well.


I summarized my feelings here:

http://news.ycombinator.com/item?id=942771


I think that's a big argument for something like jQuery which takes care not to declare tons of globals or extend base classes. If the change doesn't use jQuery.noConflict() it probably should if for no reason other than avoiding any possibility of confusion when someone sees $() in code.

As for extensive customizations, how much additional concern does this add? It seems unlikely that those people aren't also using admin hacks to work around the areas which didn't used to be user-serviceable so they're probably going to need to be careful about upgrades for many other reasons. This at least gives a consistent baseline and widely-used extension mechanism for future work.


My customizations all use jQuery anyway :)


For anyone getting started with Django, what release will this ship with?


1.2.


I'm not a django dev -- what library was used before this?


Just plain old JavaScript - no framework. Most of the JavaScript in Django's admin predates JavaScript frameworks entirely (in fact, Simon Willison wrote getElementsBySelector for the admin, which at least partially inspired jQuery and the rest of the selector-based JavaScript APIs).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: