Apache python basic webapp for Jelastic with ASGI
-
Create a new Python environment on Jelastic, select a jelastic
apachepython
container, it's suggested to select the container2.4.57-python-3.9.18
or2.4.57-python-3.11.6
(other containers may not work) -
Under
Deployments
,Deploy from GIT / SVN
pastehttps://github.com/danielemaddaluno/pyjel.git
, selectCheck and auto-deploy updates
-
Then click on
Hooks
and then onPost
and add this text:# run the setup script that will add all the required dependencies to the virtual env cd ROOT sh ./setup.sh
This will run the setup script that will add all the required dependencies to the virtual env.
If something goes wrong, for debug purposes you could use something more complex, like this:
pwd > /var/www/webroot/pwd.txt cd /var/www/webroot # run the setup script that will add all the required dependencies to the virtual env cd ROOT sh ./setup.sh
-
Click
Deploy
To test locally with PyCharm:
-
Click on
Add New Interpreter
,Add Local Interpreter...
,Virtualenv Environment
,New
. -
Then add requirements with:
sh ./setup.sh
Sometimes a restart of PyCharm is required.
-
Then:
- to test with a WSGI run:
gunicorn wsgi:application
- to test with a ASGI run (bypassing the WSGI):
or
uvicorn app.app:app
or run it directly from the IDE launching thepython app/app.py
app.py
file.
- to test with a WSGI run: