Use Django view class for JSON/AJAX response.

Django’s documentation offers a working example of to create a class-based view to spit out JSON suitable for AJAX web app. This produces an easy-to-use way of responding with JSON.

As far as I’m concerned it’s a good django-equivalent to Ruby on Rails render :xml.

Fix django-crowdsourcing

I was trying to use the django-crowdsourcing for an app that I was trying to put together I kept getting this error:

TypeError: can’t compare offset-naive and offset-aware datetimes

It turns out that there is a new concept for Django 1.4 timezones. To fix the problem you need to install some python libraries and replace use of the standard python datetime object.

terminal% pip install pytz
from django.utils import timezone

Look for

Replace with

Tiny Memorial - Built with Bootstrap

At Sakura Media, my co-worker and I pumped out a site called Tiny Memorial, a website for creating online memorials for pets or people. We built the project relatively quickly. We started work a Thursday afternoon and launched the product on the following Wednesday afternoon.

tiny memorial screen shot

The application was fairly simple to design because there are other online sites out there. The difference between the other sites and Tiny Memorial is that this site was “bootstrapped” by using a panoply of technologies and we have some social networking features that the other guys don’t.

Django 1.4 — Bleeding-edge Django tech. We were working on a RC candidate version and 1.4 became stable a few days after we launched.

Django socialauth — Allows visitors to login/join with Twitter or Facebook.

Twitter Bootstrap 2 — I really like working with Bootstrap. The engineer did an amazing job of making making the CSS really flexible. I aspire to achieve this level of CSS modularity/reusability. Visually, Bootstrap out-of-the-box is also great. All the UI elements and buttons are just there and I barely messed with them at all. In fact the ugly greenish yellow gradient for the header is all my choosing.

Compass — Ruby tool that compiles SASS and has a ton of ways to make life easier including cross-browser CSS3. I use Compass so much I haven’t used a -webkit prefix in months.

Facebook integration — When Facebook users create a new memorial we push the content onto their timeline. Fun stuff.

Syndicate content