Spaces:
Running
Running
add readme
Browse files
app.py
CHANGED
@@ -1405,11 +1405,35 @@ ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "-
|
|
1405 |
app_py_path = os.path.join(src_dir, "streamlit_app.py")
|
1406 |
with open(app_py_path, "w") as f:
|
1407 |
f.write(code)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1408 |
# Prepare files to upload
|
1409 |
files_to_upload = [
|
1410 |
(req_path, "requirements.txt"),
|
1411 |
(dockerfile_path, "Dockerfile"),
|
1412 |
(app_py_path, "src/streamlit_app.py"),
|
|
|
1413 |
]
|
1414 |
else:
|
1415 |
file_name = "app.py"
|
|
|
1405 |
app_py_path = os.path.join(src_dir, "streamlit_app.py")
|
1406 |
with open(app_py_path, "w") as f:
|
1407 |
f.write(code)
|
1408 |
+
# 4. Write README.md in the required format
|
1409 |
+
readme_content = f'''---
|
1410 |
+
title: {space_name.strip()}
|
1411 |
+
emoji: 🚀
|
1412 |
+
colorFrom: red
|
1413 |
+
colorTo: red
|
1414 |
+
sdk: docker
|
1415 |
+
app_port: 8501
|
1416 |
+
tags:
|
1417 |
+
- streamlit
|
1418 |
+
pinned: false
|
1419 |
+
short_description: Streamlit template space
|
1420 |
+
---
|
1421 |
+
|
1422 |
+
# Welcome to Streamlit!
|
1423 |
+
|
1424 |
+
Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
|
1425 |
+
|
1426 |
+
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community\nforums](https://discuss.streamlit.io).
|
1427 |
+
'''
|
1428 |
+
readme_path = os.path.join(temp_dir, "README.md")
|
1429 |
+
with open(readme_path, "w", encoding="utf-8") as f:
|
1430 |
+
f.write(readme_content)
|
1431 |
# Prepare files to upload
|
1432 |
files_to_upload = [
|
1433 |
(req_path, "requirements.txt"),
|
1434 |
(dockerfile_path, "Dockerfile"),
|
1435 |
(app_py_path, "src/streamlit_app.py"),
|
1436 |
+
(readme_path, "README.md"),
|
1437 |
]
|
1438 |
else:
|
1439 |
file_name = "app.py"
|