Beispiel #1
0
def card_create(request):
    packIdToNumber = None
    if request.method == 'POST':
        if request.POST['packId'] == 'friendship':
            packIdToNumber = 1
        if request.POST['packId'] == 'relationship':
            packIdToNumber = 2
        if request.POST['packId'] == 'family':
            packIdToNumber = 3
        card = Card()
        card.packId = packIdToNumber
        card.cardText = request.POST['cardText']
        card.author = request.user
        card.save()
        tasks.echo('****** This is the newly added card: ' +
                   request.POST['cardText'])
        return redirect('cards:openPack')
    else:
        return render(request, 'playcards/card_create.html')
Beispiel #2
0
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('pika').level = logging.INFO

from tasks import echo

# Since echo method is wrapped with task decorator
# it is going to be send to queue to run in background.
echo('hello world')
Beispiel #3
0
#!/usr/bin/env python
import tasks

tasks.echo("Hello Kuyruk")