Skip to content

Hosting

Tim edited this page Aug 31, 2024 · 25 revisions

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 options.

Free services

1. ScratchHost

Link: panel.justablock.online

A hosting service built specifically for hosting scratchattach backends. Operated by justablock and Ryan_shamu_YT.

  • 100% free
  • Ease of setup: 10/10

How to use:

Go to the store, click "Create server", select "Coding languages" as server nest and "Python" as server egg.

On the created server, go to "Files", add a new file called "app.py" and paste your Python code there. When you start the server, the "app.py" file will be executed.

Warning:

The platform is still under construction, therefore it isn't very reliable at the moment.

2. Back4app

Link: back4app.com

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 26 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.

3. glitch

Link: glitch.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.

Clone this wiki locally