mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Fix static routing error
This commit is contained in:
parent
3565058eea
commit
ebd99165e9
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user