Spaces:
Sleeping
Sleeping
Prathamesh Sable
commited on
Commit
·
ff6d3e1
1
Parent(s):
559247a
test code
Browse files- app.py +11 -0
- dockerfile +9 -0
- requirements.txt +2 -0
- templates/index.html +23 -0
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from flask import Flask, render_template
|
| 2 |
+
|
| 3 |
+
app = Flask(__name__)
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
@app.route("/")
|
| 7 |
+
def index():
|
| 8 |
+
return render_template("index.html")
|
| 9 |
+
|
| 10 |
+
if __name__ == "__main__":
|
| 11 |
+
app.run()
|
dockerfile
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.8
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
COPY . /app
|
| 6 |
+
|
| 7 |
+
RUN pip install -r requirements.txt
|
| 8 |
+
|
| 9 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
flask
|
| 2 |
+
gunicorn
|
templates/index.html
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<title>FlaskTest</title>
|
| 6 |
+
</head>
|
| 7 |
+
|
| 8 |
+
<body>
|
| 9 |
+
<h2>Welcome To Flask</h2>
|
| 10 |
+
<h4>Flask: Rendering Templates</h4>
|
| 11 |
+
<!-- this section can be replaced by a child document -->
|
| 12 |
+
{% block body %}
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
<p>This is a Flask application.</p>
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
{% endblock %}
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
</body>
|
| 22 |
+
|
| 23 |
+
</html>
|