Browse Source

Add 'from celery.task import task' to examples in tasks userguide

Ask Solem 13 years ago
parent
commit
ef47ecb9aa
1 changed files with 4 additions and 0 deletions
  1. 4 0
      docs/userguide/tasks.rst

+ 4 - 0
docs/userguide/tasks.rst

@@ -25,6 +25,8 @@ Given a function create_user`, that takes two arguments: `username` and
 
     from django.contrib.auth import User
 
+    from celery.task import task
+
     @task
     def create_user(username, password):
         User.objects.create(username=username, password=password)
@@ -79,6 +81,8 @@ Example Usage
 
 ::
 
+    from celery.task import task
+
     @task
     def add(x, y):
         print("Executing task id %r, args: %r kwargs: %r" % (