Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,11 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
app = Flask(__name__)
|
| 4 |
|
|
@@ -36,4 +43,4 @@ def home():
|
|
| 36 |
return render_template_string(html_content)
|
| 37 |
|
| 38 |
if __name__ == '__main__':
|
| 39 |
-
app.run(debug=True,port=7860)
|
|
|
|
| 1 |
+
import subprocess
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
try:
|
| 5 |
+
from flask import Flask, render_template_string
|
| 6 |
+
except ImportError:
|
| 7 |
+
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'flask'])
|
| 8 |
+
from flask import Flask, render_template_string
|
| 9 |
|
| 10 |
app = Flask(__name__)
|
| 11 |
|
|
|
|
| 43 |
return render_template_string(html_content)
|
| 44 |
|
| 45 |
if __name__ == '__main__':
|
| 46 |
+
app.run(debug=True, port=7860)
|