testline
This commit is contained in:
12
app.py
12
app.py
@@ -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)
|
||||||
Reference in New Issue
Block a user