How to Setup Python Flask App on Shared Hosting without Sudo

I ❤ Linux



python --user
export PATH=$PATH:~/.local/bin
pip install --user flask
from flask import Flask, render_template
app = Flask(__name__)
def home():
return render_template('home.html')
if __name__ == '__main__':
{% extends "layout.html" %}
{% block content %}
<h1>Python 2.6 Web Server</h1>
<h2>Using Flask and Jinja2</h2>
{% endblock %}
<!DOCTYPE html>
<meta charset="utf-8">
<title>{% block title %}DGtech — Flask App{% endblock %}</title>
{% block head %}
{% endblock %}
{% block content %}{% endblock %}
import sys
sys.path.insert(0, '<YOUR PATH>')
from wsgiref.handlers import CGIHandler
from myapp import app
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ <YOUR PATH>/$1 [L]




Entrepreneur & Full Stack Developer |

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Doruk Gezici

Doruk Gezici

Entrepreneur & Full Stack Developer |

More from Medium

Nuxt 3 and Django RestFramework works in Docker

Containerize a Python FastApi Into Docker Images

Flask + Celery Ultimate Guide NO BS.

Top Django Development Companies In The UK