get_random_string defined if unable to import

Issue #141
django.utils.crypto.get_random_string is not available in django 1.3 so
we have to define it locally if it doesn't import.