I am working on an application that, besides providing a dynamic website, also talks to an iPhone application. What happens when the iPhone, or a web visitor, triggered a bug in the application?
Django actually provide a nice mechanism to report error in its “batteries included” goodness. You can easily setup the Django environment so that [...]
Entries Tagged as 'django'
Django Production Error Handler
March 6th, 2009 · No Comments · django
Tags: django
Fix Python source code to use spaces instead of tabs
December 7th, 2008 · 9 Comments · django
What if someone gave you a Python source file that is indented using tabs? If you are using emacs, the following will let you convert it back to using spaces:
# first set the buffer tab width to 4 (or whatever you like)
M-x set-variable <return> tab-width < return> 4
# then mark the entire file
C-x h
# do [...]
Tags: python
I am in the NY Times, sorta
November 15th, 2008 · 1 Comment · django, managing, technology
Check out the NYTimes article on WilsonDailyPrep. We at Imperial Consulting did the application, using Django and Python. It is a great service and a lot of fun to work on (my own vocab and grammar has gotten better, the Math quizzes are too easy). I am glad it is getting the big time publicity [...]
Tags: business
Serving favicon in an Django App using Apache
August 13th, 2008 · 6 Comments · django
I got a free few minutes to work on my own site here. Since I migrated the site from all static pages to Django served, I still haven’t put back the favicon icon back onto the site. The sites runs under a virtual host in apache2 at WebFaction. This is what you need to put [...]
Tags: django
Resetting Django Admin Password
August 7th, 2008 · 1 Comment · django
This barely qualifies for a blog post, but what to do if you loaded, via django-admin.py loaddata
a full json file from someone during testing, and don’t have their user’s password?
Just run the django-admin.py shell, and by hand reset all the passwords:
from django.contrib.auth.models import User
for u in Users:
u.set_password(’secret’)
u.save()
That’s why you have to keep your shell login [...]
Tags: django
Django and PyTextile Revisited
July 1st, 2008 · 1 Comment · django
I wrote a post earlier about PyTextile not working well in Django. James Bennet was nice enough to add some pointers to the issue. (Comments are working now on my Blog). Now that I am using textile more, I want to investigate and document the issue better.
Most importantly, the problem exists only with the0.96x version [...]
Tags: django python
J2EE to Django, slides for the Presentation at Cambridge Python Meetup
June 29th, 2008 · No Comments · django
I gave a short presentation on Django to the Cambridge Python Users group earlier. Nate has a great writeup of the event and the other presentations that evening. I just want to share the slides here. The slides are just visual reminders and do not stand on their own. If you want more info free [...]
Tags: django
Django Tip: No leading slash for upload_to for FileField and ImageField
May 9th, 2008 · No Comments · django
This is a common mistake. When defining a FileField or an ImageField, you need to specify
where the files are stored. This is done by specifying a relative path in the upload_to
argument. Django will then store your files in a subdirectory as named, under the MEDIA_ROOT
directory. But, don’t put a leading slash in the relative path. [...]
Tags: django
Django Tip: Outputting list of items separated by commas, but only if it has more than one item
April 24th, 2008 · No Comments · django
How many times do you need to do this? You have a list of things to output. The list can be empty, has one element, or more. You want to separate each items with a separator for readability. What do you do?
1. The simple but not reader friendly way:
toppings = [ 'cheese','tomatos','pineapple' ]
or toppings = [...]
Tags: django
Emacs for OS X Leopard
January 30th, 2008 · No Comments · django, mac, technology
I have been using the text mode emacs up to now. On Windows (yikes!) I uses the xemacs with windows extension, which is pretty nice. Quick googling found me Carbon Emacs. It has been updated, universal binary and Leopard. Highly recommended !
I Love Social BookmarkingSubscribeDiggdel.icio.usFacebookMa.gnoliaRedditStumbleUponTechnorati
Tags:
