Sites and apps

How to put a Python site online

· 3 min read

In short

To put a Python site online, gather the code in one folder with requirements.txt and upload it as an archive or from GitHub. Netrun detects Python, installs the dependencies and gives you an HTTPS link — no server of your own, no nginx and no manual certificate. Flask, FastAPI and Django all work; the app should listen on 0.0.0.0 and the port from the PORT variable.

  • Netrun recognizes a Python project by its requirements.txt file and installs the dependencies listed there itself.
  • A Flask, FastAPI or Django site has to listen on 0.0.0.0 and the port from the PORT environment variable.
  • Netrun asks for API keys and the database connection string during setup and stores them encrypted rather than in the code.
  • To publish a new version of the site, update the code in the dashboard and Netrun rebuilds the project.
  • On the Free plan a site sleeps without visitors and wakes on its own, while on the Pro plan it runs without sleeping.

The usual way to publish a Python site is to rent a server, install gunicorn or uvicorn, set up nginx as a proxy, get a certificate for HTTPS and keep an eye on all of it. That is a lot of steps before the site opens at a link.

With Netrun you just upload your code. The platform detects that it is a Python project, builds it and gives you a working address with HTTPS. Let us go through it step by step.

  1. Put your project together#

    Place your code in one folder with a requirements.txt dependencies file. Any framework works — Flask, FastAPI or Django. Make sure the project runs locally.

  2. Upload your code to Netrun#

    As a ZIP archive or by importing from a GitHub repository. Netrun detects Python and builds the project itself — there is no build setup to do by hand.

  3. Answer a couple of questions#

    If your project needs secrets — API keys, a database connection string — enter their values during setup. That way they do not live in your code.

  4. Get your link#

    Once the build is done, Netrun gives you a public address with HTTPS. The site is available to anyone you share the link with.

  5. Update and keep an eye on it#

    Logs and status are in your dashboard. To put a new version online, update your code and Netrun rebuilds the project.

A Python site online — without a server, nginx or manual HTTPS. Projects on Node.js, Go, PHP and other languages deploy the same way. Try Netrun.

Common questions

Which framework should I pick for my first Python site?

For a small site or an API, Flask or FastAPI is simplest: little code and a quick start. Django is handy when you need an admin panel, users and database work from day one. All three are published the same way.

Do I need to upload the venv folder?

No. The requirements.txt file is enough: Netrun installs the dependencies itself. You can generate the list with pip freeze > requirements.txt in an activated environment.

Why does the site work locally but not at the link?

Most often the app listens on 127.0.0.1 instead of 0.0.0.0, or the port is a hardcoded number instead of coming from the PORT variable. Another common cause is a library missing from requirements.txt. The error details are in the logs in your dashboard.

Will the site data survive a code update?

Yes, if the app writes it to the persistent /data folder: its contents survive code updates and restarts. Anything written outside /data disappears on the next publish.

Can I publish a Python bot or script instead of a website?

Yes. If the program does not listen on a port, Netrun runs it as a background process with no link. On the Free plan a bot or script runs for a limited time; around the clock takes the Pro plan.

Get your own project online

Upload your code, answer a couple of questions and get a working link. There is a free plan

Try Netrun
All blog articles