1👍
It seems your project (application) is not importable.
Your options:
- Create a proper Python package (setup.py), install it with
pip install /project/directory
. That will create copy of your files invirtualenv/lib/python-version/site-packages/
. By the book, but rarely used approach. pip install -e /project/directory
also requires setup.py, will symlink project into site-packages, so it’s a one shot operation for each virtualenv. Widely used among package developers.- Take care of
sys.path
in Python code, before your project is imported. Example:
import sys
sys.path.append('/project/directory')
- Take care of import directories via
PYTHONPATH
environment variable. Usual platform dependentPATH
rules apply (entries separated by:
everywhere but;
on Windows). This way is very popular for deployment. Example in shell:
export PYTHONPATH=/project/directory
exec /virtualenv/bin/celery worker ...
0👍
I have found a solution here:
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
The only thing I needed to do is added a file celery.py to the project’s root directory and then added few lines to init.py placed in the same directory. See docs above.
- How to feed data from django into a modal?
- How to add extra parameters to html tag from base django
- Can't receive attribute of python objects transferred as json to js
- Docker-compose connection refused from celery
- Retrieve the model name for audit
Source:stackexchange.com