Update celery windows config (#226)

* Update celery windows config

* Add evenelet for windows

* Fix setup spacing

* Another attempt for install_requires window specific installs

* Ensure setuptools and pip are latest

* Set minimum version that is suitable for windows

* Set python3.4 windows specific version of pypiwin32

* Set version of pypiwin32 to 219 for windows python3.4
This commit is contained in:
Chris Mitchell 2018-03-27 19:45:10 -07:00 committed by GitHub
parent 6ddc020734
commit 6206773740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 7 deletions

View File

@ -45,6 +45,7 @@ init:
install:
- ps: (new-object net.webclient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'C:/get-pip.py')
- "%PYTHON%/python.exe C:/get-pip.py"
- "%PYTHON%/Scripts/pip.exe install --upgrade setuptools pip"
- "%PYTHON%/Scripts/pip.exe install %DJANGO%"
- "%PYTHON%/Scripts/pip.exe install -r requirements.txt"
- "%PYTHON%/Scripts/pip.exe install -e ."

View File

@ -25,7 +25,11 @@ separate process for each):
celery -A your_project_name worker -c 1 --beat -l info
python manage.py runserver
On Windows, the ``--beat`` option may not be supported.
On Windows, the ``--beat`` option may not be supported and the `eventlet`
pool will need to be specified. This looks like:
::
celery -A your_project_name worker --pool=eventlet -l info
Through a Procfile
------------------

View File

@ -19,7 +19,10 @@ setup(
'Django>=1.8,<2',
'django-autoslug',
'django-celery-results',
'eventlet>=0.22.1 ;platform_system=="Windows"',
'jsonfield',
'pypiwin32==219 ;(platform_system=="Windows" and python_version=="3.4")',
'pypiwin32 ;(platform_system=="Windows" and python_version>"3.4")',
'six',
],
include_package_data=True,

View File

@ -1,17 +1,17 @@
from __future__ import absolute_import
import os
from django.conf import settings
from celery import Celery
from celery import app as celery_app
app = celery_app.app_or_default()
# app = Celery('{{ project_name }}')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_name }}.settings')
app = Celery('{{ project_name }}')
# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object('django.conf:settings')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
@app.task(bind=True)