Spaces:
Paused
Paused
Kastg
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,8 @@ from io import BytesIO
|
|
| 6 |
|
| 7 |
app = Flask(__name__)
|
| 8 |
|
|
|
|
|
|
|
| 9 |
IMAGE_FOLDER = "images"
|
| 10 |
app.config["UPLOAD_FOLDER"] = IMAGE_FOLDER
|
| 11 |
|
|
@@ -56,8 +58,11 @@ def upload_image():
|
|
| 56 |
# Update available images dictionary
|
| 57 |
available_images[filename] = {"url": url, "name": filename}
|
| 58 |
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
|
| 62 |
if __name__ == "__main__":
|
| 63 |
-
app.run(host="0.0.0.0", port=7860, debug=True)
|
|
|
|
| 6 |
|
| 7 |
app = Flask(__name__)
|
| 8 |
|
| 9 |
+
BASE_URL = "http://yourwebsite.com" # Update this with your actual base URL
|
| 10 |
+
|
| 11 |
IMAGE_FOLDER = "images"
|
| 12 |
app.config["UPLOAD_FOLDER"] = IMAGE_FOLDER
|
| 13 |
|
|
|
|
| 58 |
# Update available images dictionary
|
| 59 |
available_images[filename] = {"url": url, "name": filename}
|
| 60 |
|
| 61 |
+
# Construct the full image URL including the site name
|
| 62 |
+
full_image_url = f"{BASE_URL}/images/{filename}"
|
| 63 |
+
|
| 64 |
+
return jsonify({"message": "File uploaded successfully", "image_url": full_image_url})
|
| 65 |
|
| 66 |
|
| 67 |
if __name__ == "__main__":
|
| 68 |
+
app.run(host="0.0.0.0", port=7860, debug=True)
|