def add_video(request): video_url = request.args.get('video_url', '') name = request.args.get('name', '') if not name: name = "" try: video = Video( name = name, video_url = video_url ) video.save() except: print "Unexpected error:", sys.exc_info() dict_notify = {'notify': "video_added", "id": str(video['id']) } pipe_left.send(cPickle.dumps(dict_notify)) return ""