Przeglądaj źródła

Also show upgrading instructions when "manage.py celeryd" is run.

Ask Solem 15 lat temu
rodzic
commit
c0f9694a92

+ 0 - 0
celery/management/__init__.py


+ 0 - 0
celery/management/commands/__init__.py


+ 16 - 0
celery/management/commands/celeryd.py

@@ -0,0 +1,16 @@
+"""
+
+Start the celery daemon from the Django management command.
+
+"""
+from django.core.management.base import BaseCommand
+
+import celery.models # <-- shows upgrade instructions at exit.
+
+
+class Command(BaseCommand):
+    """Run the celery daemon."""
+    help = 'Run the celery daemon'
+
+    def handle(self, *args, **options):
+        pass

+ 9 - 1
celery/models.py

@@ -5,9 +5,15 @@ celery.models has been moved to djcelery.models.
 This file is deprecated and will be removed in Celery v1.4.0.
 
 """
+import atexit
+
 from django.core.exceptions import ImproperlyConfigured
 
-raise ImproperlyConfigured("""
+@atexit.register
+def _display_help():
+    import sys
+
+    sys.stderr.write("""
 
 ======================================================
 ERROR: celery can't be added to INSTALLED_APPS anymore
@@ -41,3 +47,5 @@ Celery 1.2.0 Changelog as well:
     http://github.com/ask/celery/tree/djangofree/Changelog
 
 """)
+
+raise ImproperlyConfigured("Please install django-celery")