diff options
author | xengineering <mail2xengineering@protonmail.com> | 2020-09-03 10:51:58 +0200 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2020-09-03 10:51:58 +0200 |
commit | 531f9bf63d34a9e54837c8a0bf69da9a08a82525 (patch) | |
tree | 16785ac459619fab79ea4a5e6c8656d184e08e6c | |
parent | 9991f2fc1d648a7dd738ff8ded7a39b4a6e71c5d (diff) | |
download | web-template-531f9bf63d34a9e54837c8a0bf69da9a08a82525.tar web-template-531f9bf63d34a9e54837c8a0bf69da9a08a82525.tar.zst web-template-531f9bf63d34a9e54837c8a0bf69da9a08a82525.zip |
Restructure Files and Directories
-rwxr-xr-x | main.py | 15 | ||||
-rw-r--r-- | static/css/style.css (renamed from static/style.css) | 0 | ||||
-rw-r--r-- | templates/index.html (renamed from static/index.html) | 2 |
3 files changed, 6 insertions, 11 deletions
@@ -30,19 +30,14 @@ app = Flask(__name__) @app.route('/') def index(): - return current_app.send_static_file('index.html') + return render_template('index.html') -@app.route('/style.css') -def style(): - return current_app.send_static_file('style.css') - - -@app.route('/favicon.ico') -def favicon(): - return current_app.send_static_file('favicon.ico') +@app.route('/static/css/<css_file>') +def css(css_file): + return current_app.send_static_file("css/{}".format(css_file)) if __name__ == '__main__': serve(app, listen='*:8080') # production server - #app.run() # test server + #app.run() # debug server - NOT FOR PRODUCTION! diff --git a/static/style.css b/static/css/style.css index fd92176..fd92176 100644 --- a/static/style.css +++ b/static/css/style.css diff --git a/static/index.html b/templates/index.html index 90e5f1f..67e2d78 100644 --- a/static/index.html +++ b/templates/index.html @@ -21,7 +21,7 @@ <title>Web Template</title> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="style.css" type="text/css"> + <link rel="stylesheet" href="static/css/style.css" type="text/css"> </head> <body> <div class="menu"> |