What is Python?
Python is a popular programming language. It is known for being easy to read. People use it for websites, data work, automation and many other things. Websites are often built with Python frameworks, ready-made toolkits such as Django and Flask.
What is Python hosting?
It is hosting where the server can run Python code. A simple website of HTML files needs nothing special. A Python site is a program that must be started and kept running. So the hosting needs the right tools. Ask Hostvento support whether your plan supports Python apps.
What you need
- A Python version that your app supports.
- An app server. This is a program that connects the web server to your Python code. Names include Gunicorn, uWSGI and Passenger. WSGI is the standard way a Python web app talks to a web server.
- A virtual environment. A private folder that holds the packages for one project, so projects do not clash.
- A database, such as MySQL, PostgreSQL or SQLite.
- SSH access, if possible. SSH lets you open a text window on the server to run commands.
Where Python can run
- Shared hosting with a Python app tool. Some control panels have a section for setting up Python apps with a few clicks.
- VPS. Your own private slice of a server. You install what you need. This needs root access.
- Dedicated server. A whole server for big projects.
Basic steps to start
- Check that your plan supports Python apps.
- Connect with SSH or open the Python app tool in your control panel.
- Create a virtual environment:
python3 -m venv myenv
This makes a folder named myenv for the project packages.
- Switch it on:
source myenv/bin/activate
This makes the commands use the private packages.
- Install packages from your list:
pip install -r requirements.txt
This installs everything your project needs. Pip is the Python package installer.
- Point the app server to your app file and start it.
- Add an SSL certificate so the site uses https.
Warning: Back up your files and database before you update packages or Python versions. A change can break an app.
requirements.txt file. It lists the packages you need and makes rebuilding easy.Not sure? Open a support ticket before uploading.
Quick recap
- Python hosting runs sites written in Python, like Django or Flask apps.
- It needs Python, an app server and a virtual environment.
- Some shared plans offer Python tools. Otherwise use a VPS.
- Use
venvandpipto manage packages. - Back up before updates.