Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import os
|
|
| 3 |
from werkzeug.utils import secure_filename
|
| 4 |
|
| 5 |
app = Flask(__name__)
|
| 6 |
-
app.config['UPLOAD_FOLDER'] = '
|
| 7 |
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
|
| 8 |
|
| 9 |
stories = []
|
|
@@ -95,7 +95,7 @@ def add_story():
|
|
| 95 |
if photo.filename != '':
|
| 96 |
filename = secure_filename(photo.filename)
|
| 97 |
photo.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
|
| 98 |
-
stories.insert(0, {'image':
|
| 99 |
return redirect(url_for('index'))
|
| 100 |
|
| 101 |
if __name__ == '__main__':
|
|
|
|
| 3 |
from werkzeug.utils import secure_filename
|
| 4 |
|
| 5 |
app = Flask(__name__)
|
| 6 |
+
app.config['UPLOAD_FOLDER'] = '.' # Используем текущую директорию
|
| 7 |
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
|
| 8 |
|
| 9 |
stories = []
|
|
|
|
| 95 |
if photo.filename != '':
|
| 96 |
filename = secure_filename(photo.filename)
|
| 97 |
photo.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
|
| 98 |
+
stories.insert(0, {'image': filename}) # Сохраняем только имя файла
|
| 99 |
return redirect(url_for('index'))
|
| 100 |
|
| 101 |
if __name__ == '__main__':
|