try:
        tag = Tag.objects.get(name=tag_name)
    except Exception as e:
        print e
        print >>sys.stderr, "Tag %s does not exist." %(tag_name)