"Non-Node project" needs documentation (or is there such a thing?)

On a thread regarding a Python project, @cori mentioned that

  1. to use Python your project must not have a package.json file. Having one of those tells Glitch that your project is a Node project, not a Python one.
  2. your project must have a start.sh file that tells Glitch what bash commands to run to start your Python project successfully.

However, when I test this configuration, Glitch doesn’t seem to recognize it, and it runs its default server.

Demonstration: the one with package.json and the one without it.
Expected behavior: the start script runs, outputs “start” to the log, and the files at public/ is served.
Actual behavior: “start” is not printed, and the default server runs instead.

In the meantime, what you can do is set up a npm start script as you would normally do. Instead of calling a Node.js script, execute whatever Python script you want to run a la python3 server.py. Running Python this way seems to require the minimum amount of tweaking.

Folks, I noted in the post @Bubbler linked to that I neglected a key piece of information in that post - namely that Python projects must have a requirements.txt file (even an empty one) as well as not having a package.json file; that post has been updated with the full information.

The project without a package.json linked to above is actually in “static website mode”, not Python mode; static websites are run on Glitch using lws, whose output is similar to what you see when using Python’s http.server.

We’ve been talking about how best to document these expectations for a bit now; thanks for the feedback!

1 Like