After Mehmet S. Catalba launched a new Django-Mingus powered blog, yesterday, I thought it was time I sat down and wrote a brief description accompanied with brief annotations for each reusable app and how they fit into Mingus. The below discusses all 28 (34 actually but 6 are django.contrib apps I don't discuss here) reusable apps Mingus leverages.
Description: Simple prebuilt applications.
Notes: I've launched a handful of blogs using the original, google code hosted, django-basic-apps. There's no bells and whistles but it simply gets the job done, and combine basic-blog with the included basic-media and basic-inlines you can get a long way. Nathan Borror provides a terrific collection of reusable apps in the greater basic-apps project and all are worthy of a visit from noobs and experienced developers. There's not only basic stuff in there so check it out.
The basic-apps version that Mingus uses is a fork of Borror's
original project by LincolnLoop to make it PIP
compliant. I've added a Settings and BlogRoll models to the
basic-blog. And I added a new app django-basic-elsewhere that replaces
Mingus 0.1 dependency on django-elsewhere. The Settings model moves various settings found in the 0.1 version of mingus out of
settings.py and into the admin, allowing for the easy management of various blog settings (# of posts in a list view, about blurb, global
meta information, ping google, disqus shortname, feed url, etc). I also removed the dependency on the Django Comments app in favor of Django-Diqus, mentioned below.
BlogRoll does what you think it does - allows you to add a blogroll to your blog. I used this as an opportunity to demo inline edit on the list view (a great addition to Django 1.1) of BlogRoll. So check that out if it's new to you.
The reason I replaced Leah Culver's django-elsewhere is that there was a syncdb issue with django-elsewhere and Postgres. I also wanted something a little simpler for the blog app as django-elsewhere provides more features than what is needed for Mingus, but it may be perfect for what you're looking to do.
Description: A configurable set of panels that display various debug information about the current request/response.
Notes: A must have for every Django application. Rob Hudson the the contributors have done an amazing job. There's a reason this is the #2 followed Django application on github. It's terrific for debugging your DB queries, templates, etc. And now it comes with a slick new UI in the 0.8 version. Great app. Just fire up Mingus via runserver to see it in action. Make sure to view the Django-Debug-Toolbar screencast to get a quick introduction.
Description: A reusable django application to create a proxy object for your models. Intended to aggregate various content types into a model for reuse.
Notes: This is the one app that I question using myself. The reason is simple, for this app to function I forced myself to include an inner class (ProxyMeta) in basic-blog and also django-quoteme apps much like the Meta class Django uses. Why does this bother me? I questioned myself doing this because those two apps don't use the inner ProxyMeta class themselves. That addition of the inner class solely exist for Mingus. Although the addition of the inner class doesn't offend those apps, it does offend the programmer inside of me. With some more thought I assume I could decouple that binding (I'm thinking adding an additional argument to the signal handler will probably do the trick).
So, what django-proxy provides is an aggregation of different content types by denormalizing fields on various models into one database table (using signals to update/delete changes to those denormalized fields). This concept was initially used on my old blog (howiworkdaily.com) and a hacked version in the TWiD (thisweekindjango) "everything" feed. I like to say this is a poorman's django-tumbleweed, which defines itself as "A framework for creating tumblelog views of Django models indexed by Haystack" to provide similar functionality. What I like about django-proxy is that the denormalized data is available in the database and the relationship to the source object is available via Generic Relation, if needed.
Description: A generic tagging application for Django projects.
Notes: Not much to add here. Mingus uses tagging with both blog posts and quotes.
Description: Intelligent schema migrations for Django apps.
Notes: Mingus doesn't actually use South. But it should. I've placed South as a requirement because I believe South should support reusable app migrations as well. The idea requires a longer blog post but I was lucky enough to meet Andrew Godwin (lead developer behind South) at DjangoCon09 and beyond fumbling his name during an introduction, I had the opportunity to mention the idea to him. Lucky for me it was in the company of reusable-app pimp James Tauber who shares the same needs for Pinax. South rules. Use it.
Description: Django Custom Management Command Extensions.
much goodness in extensions I can't cover it all here, but
it's very easy to pinpoint one feature I use daily -
./manage.py shell_plus. Extensions is included because
every Django project should include it.
Description: django-chunks + headerfield + variable chunknames + "inclusion tag" == django-flatblocks
Notes: An app that evolved from Clint Ecker's django-chunks to my fork of chunks titled django-freetext. Zerok took the best parts of these apps (and other contributions) and added a bunch of features, docs, tests, etc. The app is terrific if you are looking to provide an admin interface around chunks of text; little snippets of text your staff may want to edit like footer, for example, or text blocks on the homepage, etc.
Description: Curated collection of all the sweet Django helpers/utilities developers create, and sometimes recreate too often.
Notes: I created django-sugar as I found myself using the the same snippets over and over again in various projects. There's some argument about projects like django-extensions, and libraries like django-sugar, in that they become too bloated. The discussion parallels the django.contrib discussion on what should be included or shouldn't be included, who decides, and what effect does "blessing" snippet/module over another one have on innovation, etc. So to put anyone's ideas to rest, django-sugar is a project for myself but feel free to use, fork, etc. The one thing I make sure to do throughout django-sugar is attribute the author with names, urls, etc.
Some examples of what utilities Mingus uses:
admin image widget - the default in the Django admin for an ImageField is to not display a thumbnail of the image but to display a link to view the image, which works perfectly fine. But by adding this widget to your project you can very easily give your clients a nice feature boost allowing them to view thumbnails of the image inline on the form. Peter Baumgartner added this Django snippet awhile ago and I've been using it ever since. It can be found here in django-sugar.
UserBasedExceptionMiddleware - helper debugging middleware created by Eric Holscher that allows any user authenticated with admin privileges or any requests originating from an IP in the settings.py INTERNAL_IPS tuple to see the unfriendly error message/stack trace Django generates. All other users see the friendly error message you're application delivers. It can be found here in django-sugar.
AwesomeMiddleware - ok so this isn't essential but I wanted to add a little fun to the project. If you activate this middleware you'll find the friendly Django pony floating in the bottom right hand corner of your browser window on every single page of your site. The concept came from the awesomness at DjangoCon08 and some late nights on IRC. Justin Lilly and I threw this one together and it really hasn't received the attention it doesn't deserver, until now. The awesomeness can be viewed here in django-sugar.
Description: An extensible contact-form application for Django.
Notes: A contact form is a pretty standard requirement for any blog application. James Bennett makes that easy with his Django-Contact-Form. I took the opportunity of combining Django-Honeypot and Django-Contact-Form to create first level anti-spam protection with Honeypot. I also wanted to provide an example of wrapping a reusable app view with a custom project view. Nothing fancy going on but you can check it out here.
As I often mention, Mingus is both an learning/sandobox project (for myself and possibly others) as well as a playground to test out reusable Django apps and provide some real world example of these in action. This was a good opportunity to do both with Contact-Form and Honeypot, discussed more below.
Description: Easily integrate DISQUS comments into your Django website.
Notes: The version of Django-Disqus that Mingus uses is my fork of the Arthur Koziel's original django-disqus. The reason I'm working with a fork is because I needed the ability to provide an additional arguments to the disqus template tag, which previously relied on a value set in settings.py and since the Settings model in basic-blog allows you to set the disqus shortname via the admin user interface I needed the ability to pass this additional argument to the template tag.
Description: Dynamic site navigation trees for django sites.
Notes: Not much to add here. Navbar allows the user to add/delete navigation via the admin, with some additional features like permissions if needed.
Description: Exception logging to a database in Django.
Notes: I posted a question in django-users IRC channel asking whether or not Django had a database error loggin module (in my asp.net days we had ELMAH as the defacto). In about 20 minutes David Cramer posted the alpha version of django-db-log. Ever since then I've been using it in all my apps. Mingus actually has a view setup specifically for showing how this app works. If you fire up runserver and navigate to http://127.0.0.1:8000/oops/ that will raise an exception, as noted in the view. The reason this exists is because I think DB-Log is a terrific utility for Django apps and debugging errors on your site. It's true, the same information is provided via the default error reportting via email that Django provides out of the box, but DB-Log also comes with one extra features, specifically ErrorBatch, that does a decent job and aggregating duplicate errors so you can quickly see the pain points in your app.
Source: Sorl Thumbnail
Description: Our goal is to make the best thumbnailing application for Django, balancing simplicity and extensibility.
Notes: If you're looking for a decoupled thumbnailing solution, then sorl is a great reusable app for all your thumbnailing needs. Make sure to read the updated sorl documentation to have a better understanding of what you can do with sorl, and also all the features that sorl provides. This project is from Chris Beaven (aka SmileyChris).
Description: A collection of Django tools which make it easy to change text filled with oembed links into the embedded objects themselves.
Notes: It makes adding video to your site easy peasy - simply add the URL to the video in your post and let django-oembed do all the dirty work in rendering the video player. Learn more about the hotness that is oembed format. This project was originally from Eric Florenzano but the fork Mingus uses is Brian Rosner's.
Description: Library of template utilities for Django
Notes: Included to provide an example of retrieving and displaying an RSS feed. There's a lot of other goodies in there besides the parse_feed template tag, so make sure to dive in and check it out. This project is from James Bennett.
Description: A Django app for managing robots.txt files following the robots exclusion protocol.
Notes: This app was included to make managing your robots.txt rules easy via the admin. And it succeeds with flying colors at doing just that. There are other opinions on how robots.txt should be wired up using your web application server verses handing it off to Django to process. This project is from Jannie Leidel.
Notes: Because we want to be good web developers and optimize, optimize, optimize. This project is from Christian Metts.
Description: Convert text markup to html. Markdown, rST, Textile etc.
Notes: Out of the box Mingus supports (via basic-blog) raw html, markdown, and textile. This project is from Martin Mahner.
Description:* A simple django application to using Google Analytics in your project and tying different GA tags to different sites.
Notes: I forked Clint Ecker's original source to fix a hardcoded value issue, and made the project Django 1.* compliant.
Description: Django app that provides a method to do advanced view caching. It's basically a patch from http://code.djangoproject.com/ticket/11269 converted to stand-alone python package.
Notes: Because the concept is cool and we should all familiarize ourselves with the caching strategies in our apps beyond depending on Django's site-wide cache (i.e. using Django's low level caching and fragment caching). Right now the only view using this app is the homepage. I created a callable that generates the cache key based on page number. You can see how this is implemented by checking out this decorator and this function. This project is from Mikhail Korobov.
Description: Generic honeypot utilities for use in django projects.
Notes: By adding Django-Contact-Form I needed a simple way to protect against spam, and there was aslo a need to have Mingus provide an example of leveraging a decorator on a view. So, in an effort to kill two birds with one stone I integrated Django-Honeypot into Mingus. Learn more about the honeypot strategy. This project is from the good people at Sunlight Labs.
Description: A reusable app for quotes and testimonials.
Notes: Borror's django-basic-apps does have the concept of quotes and Mingus 0.1 actually uses that app in the original release. The issue I had with basic-quotes is that it relies on basic-person and offers some additional fields I didn't find necessary for my particular needs. Again, it's a terrific app so it may be exactly what you need.
I have created a few Django quote apps and testimonial apps in the past. Both a quote and a testimonial are structurally very similar and make a perfect opportunity to use the Django Abstract Base Class. So I rolled the apps into one and pushed django-quoteme.
I also used quoteme to provide an example (albeit a weak one) on how to leverage a reusable app by creating a view in your project and wrapping the reusable app view. The example I use it quite silly but it gets the basic idea across, I think. You can view what I'm referring to here.
What I most enjoyed about this project is that after I rushed a release, blogged it too early so it really wasn't ready for consumption, then added an example app and cleaned some things up... about 2 days later SmileyChris was kind enough to fork the app, code review, refactor, and email me with constructive criticism/suggestions. That's what I love about git/mercurial (DVCS), the community around github/bibucket and the open source community in general - just by putting your code out there (good or bad) you open yourself to user feedback. I was lucky enough to have the experience be a constructive one. If nothing else, open source keeps you honest.
Description: Django comes with an optional "flatpages" application. It lets you store simple "flat" HTML content in a database and handles the management for you via Django's admin interface and a Python API.
Notes: Mingus comes with one built-in flatpage, the "about" page. The flat page app has numerous use cases, so I believe it's an essential app for most projects.
Description: Django comes with a high-level sitemap-generating framework that makes creating sitemap XML files easy.
Notes: The basic-blog Setting object has a "ping google" BooleanField. So in the admin this displays as a checkbox. If you set this to checked (i.e. True) then when saving a Post the app will also execute Django's built-in ping_google() function. In confunction with the sitemaps framework, this is a nice feature for keeping Google notified when updates are made to your posts, informing Google to reindex your site.