top of page
Search
  • Writer's pictureHox Framework

Host your website and go worldwide ! Python Flask for beginners | LBOET | Hox Framework

Batch files:

Ngrok batch file >


@echo off

color 0a

cls

ngrok.exe http <your internal ip here>:80


Server batch file >


@echo off

color 0a

cls

python serverFL.py


---------------------------

Code:


from flask import Flask, render_template


app = Flask(__name__)


@app.route("/")


def main():

return render_template("main.html")


#################################

@app.route("/blog")

def blog():

return render_template("blog.html")

#################################


if __name__ == "__main__":

app.run(debug=True, host="192.168.1.106", port=80)


--------------------------------

Instructions


1.

Download Flask (trough pip) and Ngrok (from their official website)

2.

Make a new python file ,and in the same folder make templates and static

folders in which you will store your webpage (html) and css

3.

copy my code from above and run your server, make sure your folders

are filled just like mine, so that your files exist.

4.

open ngrok on http (80) on your internal ip

5.

share that link with your friends to see your beautiful website created with Flask and Python ! :)





3 views0 comments

Recent Posts

See All
bottom of page