def tweet_incident(sender, instance, created=False, **kwargs): if created: try: instance.tweet() except TwitterError as exc: print 'Exception while tweeting incident: {}'.format(str(exc))