This commit is contained in:
m
2026-03-24 21:54:07 +01:00
parent a38aad6576
commit 67ec5753bf

12
app.py
View File

@@ -126,7 +126,17 @@ def post_detail(post_id):
@app.route('/content/image/<path:filename>') @app.route('/content/image/<path:filename>')
def content_image_files(filename): def content_image_files(filename):
return send_from_directory('content/image', filename) directory = 'content/image'
full_path = os.path.join(os.getcwd(), directory, filename) # Your actual file location
print(f"Requested: {filename}")
print(f"Directory: {os.getcwd()}/{directory}")
print(f"Full path: {full_path}")
print(f"Exists: {os.path.exists(full_path)}")
if not os.path.exists(full_path):
return f"File not found: {full_path}", 404
return send_from_directory(directory, filename)
if __name__ == '__main__': if __name__ == '__main__':
app.run(debug=True) app.run(debug=True)