Jelajahi Sumber

Merge pull request #1076 from Locker537/master

Clarify 'getting started with django' documentation.
Ask Solem Hoel 12 tahun lalu
induk
melakukan
3dc57f14f2
1 mengubah file dengan 11 tambahan dan 4 penghapusan
  1. 11 4
      docs/django/first-steps-with-django.rst

+ 11 - 4
docs/django/first-steps-with-django.rst

@@ -123,16 +123,23 @@ use the help command:
 Calling our task
 Calling our task
 ================
 ================
 
 
-Now that the worker is running, open up a new terminal to actually
-call the task you defined::
+Now that the worker is running, open up a new python interactive shell
+with ``python manage.py shell`` to actually call the task you defined::
 
 
     >>> from celerytest.tasks import add
     >>> from celerytest.tasks import add
 
 
     >>> add.delay(2, 2)
     >>> add.delay(2, 2)
 
 
 
 
-The ``delay`` method is a handy shortcut to the ``apply_async`` method which
-enables you to have greater control of the task execution.
+Note that if you open a regular python shell by simply running ``python``
+you will need to import your Django application's settings by running::
+
+    # Replace 'myproject' with your project's name
+    >>> from myproject import settings
+
+
+The ``delay`` method used above is a handy shortcut to the ``apply_async`` 
+method which enables you to have greater control of the task execution.
 To read more about calling tasks, including specifying the time at which
 To read more about calling tasks, including specifying the time at which
 the task should be processed see :ref:`guide-calling`.
 the task should be processed see :ref:`guide-calling`.