Skip to content

Commit 4cbe9b2

Browse files
committed
Initial Commit
1 parent 5ca6ce0 commit 4cbe9b2

File tree

7 files changed

+57
-0
lines changed

7 files changed

+57
-0
lines changed

.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

app.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from flask import Flask
2+
import os
3+
4+
app = Flask(__name__)
5+
6+
@app.route('/')
7+
def hello_world():
8+
return 'Hello, world!'

bin/start

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
# pwd
4+
# ls -la
5+
# ls -la ./bin
6+
# env | sort
7+
# echo $PATH
8+
9+
# export FLASK_APP=app
10+
# export FLASK_ENV=production
11+
12+
# python --version
13+
14+
# python server.py
15+
16+
# gunicorn -w 1 'server:app'
17+
# python -m flask run --host=0.0.0.0 --port 3000
18+
# ./flask run
19+
20+
21+
# This works
22+
# python gunicorn_runner.py
23+
24+
25+
PYTHONUNBUFFERED=TRUE python uvicorn_runner.py

requirements.txt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
click==8.1.3
2+
Flask==2.1.1
3+
gunicorn==20.1.0
4+
h11==0.14.0
5+
itsdangerous==2.1.2
6+
Jinja2==3.1.2
7+
MarkupSafe==2.1.2
8+
python-dotenv==1.0.0
9+
uvicorn==0.22.0
10+
waitress==2.1.2
11+
Werkzeug==2.3.4

server.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import sys
2+
from gunicorn.app.wsgiapp import run
3+
if __name__ == '__main__':
4+
sys.argv = "gunicorn --bind 0.0.0.0:5151 app:app".split()
5+
sys.exit(run())

static/main.css

Whitespace-only changes.

templates/index.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!doctype html>
2+
<title>Hello from Flask</title>
3+
{% if name %}
4+
<h1>Hello {{ name }}!</h1>
5+
{% else %}
6+
<h1>Hello, World!</h1>
7+
{% endif %}

0 commit comments

Comments
 (0)