Fix static routing error

This commit is contained in:
rubenwardy 2018-05-25 15:23:55 +01:00
parent 3565058eea
commit ebd99165e9
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C
2 changed files with 1 additions and 6 deletions

@ -25,7 +25,7 @@ from flask_wtf.csrf import CsrfProtect
from flask_flatpages import FlatPages from flask_flatpages import FlatPages
import os import os
app = Flask(__name__) app = Flask(__name__, static_folder="public/static")
app.config["FLATPAGES_ROOT"] = "flatpages" app.config["FLATPAGES_ROOT"] = "flatpages"
app.config["FLATPAGES_EXTENSION"] = ".md" app.config["FLATPAGES_EXTENSION"] = ".md"
app.config.from_pyfile(os.environ["FLASK_CONFIG"]) app.config.from_pyfile(os.environ["FLASK_CONFIG"])

@ -31,11 +31,6 @@ cache = SimpleCache()
def domain(url): def domain(url):
return urlparse(url).netloc return urlparse(url).netloc
# Use nginx to serve files on production instead
@app.route("/static/<path:path>")
def send_static(path):
return send_from_directory("public/static", path)
@app.route("/uploads/<path:path>") @app.route("/uploads/<path:path>")
def send_upload(path): def send_upload(path):
return send_from_directory("public/uploads", path) return send_from_directory("public/uploads", path)