-
Notifications
You must be signed in to change notification settings - Fork 49
Hosting
If you want your Python code to run 24/7, you'll either need to use a hosting service or host locally. This page lists different hosting services. If you know a hosting option that isn't listed here, open an issue to ask for it to be added.
A platform offering Container as a service (CaaS). This allows you to use any coding language.
- On free plan, you get 600 free deploy hours per month. This means your app will run for 25 days per month.
- Ease of setup: 6/10
How to use:
To get started, fork this template on GitHub: https://github.com/templates-back4app/containers-python-flask-sample/blob/main/app.py
Edit your Python code so that the lines executing your backend server (like client.run()
or events.start()
) are inside a def run():
function.
Then, add a backend_code.py
file and paste your Python code to it. Go to the app.py
file and add this code to line 2:
from threading import Thread
import backend_code
Thread(target=backend_code.run).start()
After you did that, go to back4app, create a new app and select "Container". Back4app will ask you to log in with GitHub. Select the repository fork you created before. If everything was done correctly, your code should be executed as soon as the container has started.
Warning:
Your app will only stay awake if you ping it using a pinger like uptimerobot.com.
A platform primarily for hosting JavaScript code that also allows hosting Python 3 code.
- 100% free
- Ease of setup: 4/10
How to use:
Remix this glitch template: https://glitch.com/edit/#!/remix/python3web
Warning:
Your app will only stay awake if you ping it. Unfortunately, popular options like uptimerobot.com are blocked and don't work.
Offers different tiers for hosting Python code. Very easy to set up. However, replit's pricing has skyrocketed over the last two years and is now pretty expensive.
Offers cheap VPS (Virtual private servers) for hosting any kind of code. The lowest tier offered is enough for hosting scratchattach backends. However, a VPS is way harder to set up than other hosting options.
Not sponsered. The Easy of use
rating takes factors like the time required to set up into account, but isn't purely objective.