Deploy this application using Celery and Gunicorn. To follow this tutorial, you need a Clever Cloud account and Clever Tools:
npm i -g clever-tools
clever loginYou can also install Clever Tools with many packages managers.
Create and configure a Python application:
git clone https://github.com/CleverCloud/celery-gunicorn-example
cd celery-gunicorn-example
clever create -t python
clever env set CC_PYTHON_BACKEND "gunicorn"
clever env set CC_PYTHON_MODULE "app:server"
clever env set CC_PRE_RUN_HOOK "bash workers.sh"Everything is now ready, just deploy the application and open it:
clever deploy
clever openYou can now use the application by making a GET request to the following URL:
https://<your-app-url>?text=This%20is%20a%20demo
You can also add operations to the request by adding the following parameters:
reverse: reverse the textuppercase: convert the text to uppercaselowercase: convert the text to lowercaserepeat_count: repeat the text a number of times specified
For example, to reverse the text, you can make a GET request to the following URL:
http://<your-app-url>?text=Hello%20world!&reverse=true
You can also combine multiple operations:
http://<your-app-url>?text=Hello%20world!&reverse=true&uppercase=true&repeat_count=3