Nov-11-2016, 03:00 PM
Please sto using CGI in Python,it's dead after WSGI.
Use Flask
Eg.
pip install flask
Folder setup:
In browser http://127.0.0.1:5000/
Use Flask
Eg.
pip install flask
Folder setup:
foo\ app.py templates\ index.html static\ css\ style.cssapp.py
from flask import Flask, render_template app = Flask(__name__) @app.route("/") def bak_image(): return render_template("index.html") if __name__ == '__main__': app.run()index.html
<html> <head> <link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/style.css') }}" /> </head> <title> Wsgi trough Flask </title> <body> <h1>My name is zzzzzz</h1> </body> </html>style.css
*{ padding: 0px; margin: 0px; font-size: 20px; } h1{ color: blue; }Run python app.py.
In browser http://127.0.0.1:5000/