Jump to content

How to use other WSGI modules in conjuction with Python Flask on Johnny server?


Recommended Posts

Posted

Flask docs tells me (here: https://flask.palletsprojects.com/en/stable/deploying/ ) that I shouldn't just use the normal flask server by itself, and recommends pairing it with Gunicorn, waitress, or some other library. I'm gonna choose gunicorn, as it is the only one of their list that Johnny has installed (here: https://krydos2.heliohost.org/pyinfo/info3.12.py ).

However, Heliohost offers no shell, so I cant use their `gunicorn main:app` command.  How am I supposed to use it? Is there some way to do so in pure python?

  • 1 month later...
Posted

Sounds like you need your own VSP if you need shell access: https://wiki.helionet.org/FAQ#Can_I_use_SSH?

Here is what Perplexity said about your situation:

Short answer: no, not in the way you’re hoping. Gunicorn is a long-running WSGI server process, and Flask’s docs describe it as something you run as a production server instead of the built-in development server. If HelioHost gives you no shell and no way to start a persistent process, you usually can’t launch Gunicorn yourself from shared hosting alone.

What “pure Python” can do
Gunicorn does have a Python entry point, so technically you can start it from Python code with something like from gunicorn.app.wsgiapp import run and then calling run() after setting sys.argv. That still does not remove the core requirement: something must execute that Python file and keep the server process alive. So “pure Python” is only a different launch mechanism, not a replacement for shell/process management.

Why this is a hosting problem
Flask’s deployment docs distinguish between the application and the WSGI server, and Gunicorn’s own docs show it as a server you install and run as a process. HelioHost’s Python docs emphasize CGI as the easy shared-hosting path, which is a very different execution model from Gunicorn’s always-on worker model. In other words, if your account can only run scripts on demand, Gunicorn is the wrong fit unless HelioHost exposes a WSGI startup hook or some equivalent service manager.

Practical options
Use HelioHost’s supported Python method, which appears to be CGI for shared hosting.

If HelioHost provides a WSGI interface or app startup configuration, point it at your Flask app rather than trying to type gunicorn main:app yourself.

Move the app to an environment where you control process startup, such as a VPS, container host, or a platform that supports a process command.

Direct answer to your question
You can write a small Python launcher for Gunicorn, but that only helps if HelioHost lets you execute that launcher as the service entrypoint. Without shell access or some admin-defined startup command, you generally cannot use Gunicorn on shared hosting in the normal way.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...