diff --git a/blog/routes.py b/blog/routes.py index 21026011d0e23ec18adb047720d1e424bbc5f2cf..a14298aa9d600726b3ec25632065741893327ad1 100644 --- a/blog/routes.py +++ b/blog/routes.py @@ -1,5 +1,6 @@ from flask import render_template, url_for, request, redirect, flash, Response, send_file, abort from blog import app, db +import os from blog.models import User, Post, Portfolio from blog.forms import RegistrationForm, LoginForm, UpdateAccountForm, PostForm from flask_login import login_user, logout_user, current_user @@ -24,8 +25,8 @@ def cv(): @app.route('/download') def download(): - path = "static/pdf/cv.pdf" - return send_file(path, as_attachment=True) + file_path = os.path.join(os.getcwd(), "blog", "static", "pdf", "cv.pdf") + return send_file(file_path, as_attachment=True) @app.route("/blog") def blog():