mirror of https://github.com/wooey/Wooey.git
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:
parent
6ddc020734
commit
6206773740
|
@ -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 ."
|
||||
|
|
|
@ -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
|
||||
------------------
|
||||
|
|
3
setup.py
3
setup.py
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue