app = Flask(__name__,
static_path='',
static_url_path=None,
static_folder='templates/assets',
template_folder='templates',
instance_path=None,
instance_relative_config=False)
app.debug = False
@app.route("/", methods=['GET'])
def index():
return render_template("index.html")
@app.route('/results/<path:filename>', methods=['GET'])
def serve_static(filename):
root_dir = os.path.dirname(os.getcwd())
#for windows too
return app.send_static_file(os.path.join('results', filename).replace('\\','/'))
What do I do wrong? http://127.0.0.1:5000/assets/result.csv this gives me an error:
Not Found The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.