3 ms·
Back when I first started looking at Django, the "apps" concept looked really promising. That you'd never need to worry about writing a comments-system again, b
by mseebach 16y ago
Back when I first started looking at Django, the "apps" concept looked really promising. That you'd never need to worry about writing a comments-system again, because there would be a comments-app. That you don't need to integrate your main app with your blog and your CMS, because they'd just be separate apps that you'd drop in and forget about.
But the mentioned apps .. aren't. They are tools, plug-ins and libraries. What a shame.
- stuartk 16y agoSome of the apps do just that, integrate nicely, don't get in the way of the rest of your project, and do their job. But many apps need all manner of templates, settings, url confs etc to use them. In those cases it's sometimes easier to write something simple yourself.
- andybak 16y agoApps could definitely be more modular and the recent addition of contrib.staticfiles to trunk will help greatly with, um, static files! Templates aren't really a problem, are they? Django will find the base ones and you can overload them if you want. settings should be handled elegantly with sensible defaults that you override if needed. And finally - the root url config is a bit of a bottleneck as every app that has URL's needs at least an include here. A registration system would be good but there are thorny issues to do with ordering of the URLs.
- po 16y agoIsn't that pretty much exactly what is delivered? Here's the comments app for example: http://docs.djangoproject.com/en/dev/ref/contrib/comments/ http://docs.djangoproject.com/en/dev/ref/contrib/comments/ For tagging you have a choice between django-tagit and django-tagging. Mingus for example took this to an extreme. Everything was a reusable app. Here's a good article from the developer about it: http://djangoadvent.com/1.2/everything-i-hate-about-mingus/ http://djangoadvent.com/1.2/everything-i-hate-about-mingus/ http://github.com/montylounge/django-mingus/ http://github.com/montylounge/django-mingus/ The one part of the reusable apps that tends not to get reused are the templates. I find the models, middleware, admin tools, etc… to be a pretty nice way to structure an app. Moreover, I think it's pretty easy to get caught in a very horizontally structured application because that's how they usually start. You put all of the models in one directory, all of the views in another, etc… I find Django urges you to think about how to slice your application into vertical chunks early on which benefits development.
- mseebach 16y agoApps sure exist. I just found it disheartening that peoples favourite apps, in a framework that, as you mention, encourages re-useable apps as much as Django do, aren't proper apps, but plug-ins and tools.
- levigross 16y agoThey are trying to fix this with class based views etc... I hope it works becauseif not they risk losing their userbase to a better framework
- rguzman 16y agoThis is a symptom of the fact that an "app" is a leaky abstraction. It is nice to think about a webapp as being a collection of apps that have well-defined narrow functionality, but it is just not the case. As soon as you start writing code you realize that the apps need to be coupled or you have to jump through major hoops to decouple them properly. Once they are fully decoupled, they look more like plugins than apps.
- Pewpewarrows 16y agoYou're confusing apps that you never have to write again with awesome apps that really define and make Django better as a whole. Nearly every common use case you can think of exists already has a Django app. Most of them are trivial, but it's nice to not have to write it again. Why would I pick commenting as my favorite app? South on the other hand, is a major improvement that I can't see myself not having on a daily basis, and it's not a trivial use case that I could knock out in an afternoon. It's well-written, brings a lot to the framework, and solves a problem that most people can't handle themselves. THAT'S a piece of code deserving to be my favorite app. I suggest you look at http://djangopackages.com/ http://djangopackages.com/ if you still (incorrectly) believe that Django apps as a whole haven't exceeded every expectation of what sets Django apart from every other mainstream framework out right now. Reusable apps that take the mundane out of web development have been a huge success, even more so with the upcoming class-based views in 1.3.