This is an implementation of Miguel Grinberg's article Using Celery With Flask with Huey replacing Celery.
Assume the following:
Virtual environment is called flask-huey-example
and is located at d:/Paul/.virtualenv/flask-huey-example
Project is located at D:/Paul/Documents/GitHub/flask-huey-example
Ensure the requirements are installed into the virtual environment.
Open a command window, change to the project directory, activate the environment and start up the dummy SMTP Server.
cd /d d:/Paul/Documents/GitHub/flask-huey-example
d:/Paul/.virtualenv/flask-huey-example/Scripts/activate.bat
(flask-huey-example) python run_smtp_server.py
Open a second command window, change to the project directory, activate the environment and start up the Huey task consumer.
cd /d d:/Paul/Documents/GitHub/flask-huey-example
d:/Paul/.virtualenv/flask-huey-example/Scripts/activate.bat
(flask-huey-example) set HUEY_APP_SETTINGS=app.config.DevelopmentConfig
(flask-huey-example) python d:\Paul\.virtualenv\flask-huey-example\Scripts\huey_consumer.py run_huey.huey
Open a third command window, change to the project directory, activate the environment and start up the Flask server.
cd /d d:/Paul/Documents/GitHub/flask-huey-example
d:/Paul/.virtualenv/flask-huey-example/Scripts/activate.bat
(flask-huey-example) set APP_SETTINGS=app.config.DevelopmentConfig
(flask-huey-example) python run_app.py
Navigate to http://localhost:6060 in your browser, click link to Example 1
and then click the Send
button.
TBD