From 2b6b14bd171bcffc2ca0f61d0dd7b35e86f0be0e Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Wed, 3 May 2023 13:31:04 -0400 Subject: Proxy Fix and requirements.txt --- main.py | 4 ++++ requirements.txt | 4 ++++ static/articles/flaskwebsite/dbbak.py | 8 ++++++++ static/articles/flaskwebsite/flaskwebsite.md | 6 ++++++ .../flaskwebsite.sync-conflict-20230503-132338-Q37XHXN.md | 1 + 5 files changed, 23 insertions(+) create mode 100644 requirements.txt create mode 100755 static/articles/flaskwebsite/dbbak.py create mode 100644 static/articles/flaskwebsite/flaskwebsite.md create mode 100755 static/articles/flaskwebsite/flaskwebsite.sync-conflict-20230503-132338-Q37XHXN.md diff --git a/main.py b/main.py index 7c530fc..05f645d 100755 --- a/main.py +++ b/main.py @@ -1,8 +1,12 @@ from flask import Flask, render_template, send_file from markdown import markdown from db import DB +from werkzeug.middleware.proxy_fix import ProxyFix app = Flask(__name__) +app.wsgi_app = ProxyFix( + app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1 +) r = DB() @app.route('/') diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3fc1f39 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Flask==2.2.3 +Markdown==3.4.3 +redis==4.5.4 +Werkzeug==2.2.3 diff --git a/static/articles/flaskwebsite/dbbak.py b/static/articles/flaskwebsite/dbbak.py new file mode 100755 index 0000000..9756cdd --- /dev/null +++ b/static/articles/flaskwebsite/dbbak.py @@ -0,0 +1,8 @@ +db_entry = { + "title": "Running a Flask based website on Nginx", + "date": "05/03/2023", + "file": "static/articles/flaskwebsite/flaskwebsite.md", + "desc": "A tutorial on setting up the Flask website on Nginx", + "url": "flaskwebsite", + "id": 2 +} diff --git a/static/articles/flaskwebsite/flaskwebsite.md b/static/articles/flaskwebsite/flaskwebsite.md new file mode 100644 index 0000000..c08da37 --- /dev/null +++ b/static/articles/flaskwebsite/flaskwebsite.md @@ -0,0 +1,6 @@ +# Running a Flask based website on Nginx + +This article assumes you have completed up to setting up Nginx based on the [Last Article](/articles/rpilinuxserver/), or that you already have a server setup. + +## + diff --git a/static/articles/flaskwebsite/flaskwebsite.sync-conflict-20230503-132338-Q37XHXN.md b/static/articles/flaskwebsite/flaskwebsite.sync-conflict-20230503-132338-Q37XHXN.md new file mode 100755 index 0000000..792d600 --- /dev/null +++ b/static/articles/flaskwebsite/flaskwebsite.sync-conflict-20230503-132338-Q37XHXN.md @@ -0,0 +1 @@ +# -- cgit v1.2.3