Browse Source

Don't use celery.start in first steps

Ask Solem 13 years ago
parent
commit
2d0f5c12da
1 changed files with 7 additions and 9 deletions
  1. 7 9
      docs/getting-started/first-steps-with-celery.rst

+ 7 - 9
docs/getting-started/first-steps-with-celery.rst

@@ -137,9 +137,6 @@ Let's create the file :file:`tasks.py`:
     def add(x, y):
     def add(x, y):
         return x + y
         return x + y
 
 
-    if __name__ == '__main__':
-        celery.start()
-
 The first argument to :class:`~celery.app.Celery` is the name of the current module,
 The first argument to :class:`~celery.app.Celery` is the name of the current module,
 this is needed so that names can be automatically generated, the second
 this is needed so that names can be automatically generated, the second
 argument is the broker keyword argument which specifies the URL of the
 argument is the broker keyword argument which specifies the URL of the
@@ -161,7 +158,7 @@ Running the celery worker server
 We now run the worker by executing our program with the ``worker``
 We now run the worker by executing our program with the ``worker``
 argument::
 argument::
 
 
-    $ python tasks.py worker --loglevel=info
+    $ celery -A tasks worker --loglevel=info
 
 
 In production you will want to run the worker in the
 In production you will want to run the worker in the
 background as a daemon.  To do this you need to use the tools provided
 background as a daemon.  To do this you need to use the tools provided
@@ -170,11 +167,11 @@ for more information).
 
 
 For a complete listing of the command line options available, do::
 For a complete listing of the command line options available, do::
 
 
-    $  python tasks.py worker --help
+    $  celery worker --help
 
 
 There also several other commands available, and help is also available::
 There also several other commands available, and help is also available::
 
 
-    $ python tasks.py --help
+    $ celery help
 
 
 .. _`supervisord`: http://supervisord.org
 .. _`supervisord`: http://supervisord.org
 
 
@@ -365,7 +362,7 @@ If you are using RabbitMQ, Redis or MongoDB as the
 broker then you can also direct the workers to set a new rate limit
 broker then you can also direct the workers to set a new rate limit
 for the task at runtime::
 for the task at runtime::
 
 
-    $ python tasks.py rate_limit tasks.add 10/m
+    $ celery control rate_limit tasks.add 10/m
     worker.example.com: OK
     worker.example.com: OK
         new rate limit set successfully
         new rate limit set successfully
 
 
@@ -377,5 +374,6 @@ and how to monitor what your workers are doing.
 Where to go from here
 Where to go from here
 =====================
 =====================
 
 
-After this you should read the :ref:`guide`. Specifically
-:ref:`guide-tasks` and :ref:`guide-calling`.
+If you want to learn more you should continue to the
+:ref:`Next Steps <next-steps>` tutorial, and after that you
+can study the :ref:`User Guide <guide>`.