Exemplo n.º 1
0
Arquivo: views.py Projeto: soszrg/web
def home_page(request):
    global res
    res = Add1.apply_async(args=[1,2], queue='z3', routing_key='z3')
    print type(res)
#     print res.get(timeout=50)
    blogs = BlogPost.objects.all()
    context = Context({'blogs':blogs})
    return render(request, "blogpost/index.html", context)
Exemplo n.º 2
0
Arquivo: views.py Projeto: soszrg/web
def home_page(request):
    global res
    res = Add1.apply_async(args=[1, 2], queue='z3', routing_key='z3')
    print type(res)
    #     print res.get(timeout=50)
    blogs = BlogPost.objects.all()
    context = Context({'blogs': blogs})
    return render(request, "blogpost/index.html", context)
Exemplo n.º 3
0
Arquivo: test.py Projeto: soszrg/web
#encoding = utf8
from BlogPost.utils.tasks import Add1
print 'test===>1'
# res = Add1.apply_async(args=[1,2], queue='z2', routing_key='z2')
res = Add1.delay(1, 2)
print 'test===>2'
print res.ready()
print res.get()
Exemplo n.º 4
0
Arquivo: test.py Projeto: soszrg/web
#encoding = utf8
from BlogPost.utils.tasks import Add1
print 'test===>1'
# res = Add1.apply_async(args=[1,2], queue='z2', routing_key='z2')
res = Add1.delay(1,2)
print 'test===>2'
print res.ready()
print res.get()