def result(key): print(key) result = BaseAsyncResult(key, app=tasks.celery) if result.ready(): return render_template('result.html', result=result.get()) elif result.failed(): return result.traceback else: return render_template('processing.html')
def ajax_account_creation_done(request, task_id): result = BaseAsyncResult(task_id, CacheBackend(default_app)) if not result.ready(): return {"ok": True, "ready": False} result = result.get() return { "ok": True, "ready": True, "slug": result['slug'], "mt4_id": result['mt4_id'], "mt4_password": result['mt4_password'], "redirect": reverse("mt4_account_welcome", args=[result['slug'], result['mt4_id']]), }