Private
Public Access
1
0

try with standalone

This commit is contained in:
Sander Roosendaal
2017-05-10 14:51:06 +02:00
parent be2f6803d3
commit 50eda6b135
3 changed files with 33 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
if __name__ == '__main__':
import django
from django.conf import settings
django.setup()
import time
from celery import app
from django_rq import job
from async_messages import message_user,messages
from rowers.models import Workout
from django.contrib.auth.models import User
@app.task
@job
def addcomment2(userid,id):
print 'aap'
time.sleep(5)
w = Workout.objects.get(id=id)
w.notes += '\n the task has run'
w.save()
u = User.objects.get(id=userid)
messages.info(u,' The task has run')
return 1