Mi sto imbattendo in questo problema e non ho assolutamente idea da dove provenga.Celery + Errore Django: TypeError: l'oggetto 'Settings' non è indicativo
Sto usando esattamente lo stesso codice fornito in the Celery tutorial eccetto per il fatto che sto usando la directory di progetto anche come la mia directory app unica (quindi, avendo models.py, views.py e aggiungendo 'proj' a INSTALLED_APPS).
La parte strana è, mentre provo questa configurazione sul mio computer locale, l'errore è sempre apparso con ogni comando di django (migrazione, shell ...). La rimozione di virtualenv e la reinstallazione li ha riparati in modo misterioso. Ora, quando spingo l'applicazione su Heroku, ho lo stesso problema e non riesco a farlo funzionare.
Eventuali suggerimenti? Grazie!
ps: Python 3.4.2, 1.8.4 Django, sedano 3.1.18
Il traceback errore:
Running `celery -A proj worker -l info` attached to terminal... up, run.7187
Traceback (most recent call last):
File "/app/.heroku/python/bin/celery", line 9, in <module>
load_entry_point('celery==3.1.0', 'console_scripts', 'celery')()
File "/app/.heroku/python/lib/python3.4/site-packages/celery/__main__.py", line 29, in main
main()
File "/app/.heroku/python/lib/python3.4/site-packages/celery/bin/celery.py", line 80, in main
cmd.execute_from_commandline(argv)
File "/app/.heroku/python/lib/python3.4/site-packages/celery/bin/celery.py", line 732, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/app/.heroku/python/lib/python3.4/site-packages/celery/bin/base.py", line 299, in execute_from_commandline
argv = self.setup_app_from_commandline(argv)
File "/app/.heroku/python/lib/python3.4/site-packages/celery/bin/base.py", line 429, in setup_app_from_commandline
self.app = self.find_app(app)
File "/app/.heroku/python/lib/python3.4/site-packages/celery/bin/base.py", line 449, in find_app
sym = self.symbol_by_name(app)
File "/app/.heroku/python/lib/python3.4/site-packages/celery/bin/base.py", line 474, in symbol_by_name
return symbol_by_name(name, imp=import_from_cwd)
File "/app/.heroku/python/lib/python3.4/site-packages/kombu/utils/__init__.py", line 92, in symbol_by_name
module = imp(module_name, package=package, **kwargs)
File "/app/.heroku/python/lib/python3.4/site-packages/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package)
File "/app/.heroku/python/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/app/proj/__init__.py", line 5, in <module>
from .celery import app as celery_app
File "/app/proj/celery.py", line 17, in <module>
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
File "/app/.heroku/python/lib/python3.4/site-packages/celery/app/base.py", line 277, in autodiscover_tasks
if self.conf.CELERY_FORCE_BILLIARD_LOGGING:
File "/app/.heroku/python/lib/python3.4/site-packages/celery/datastructures.py", line 336, in __getattr__
return self[k]
File "/app/.heroku/python/lib/python3.4/site-packages/celery/datastructures.py", line 458, in __getitem__
return d[key]
File "/app/.heroku/python/lib/python3.4/site-packages/django/utils/functional.py", line 227, in inner
return func(self._wrapped, *args)
TypeError: 'Settings' object is not subscriptable
Potrebbe postare il contenuto del '/ app/proj/__ init __. Py' e'/app/proj/files celery.py'? –