Skip to content

Commit e3a1105

Browse files
committed
init app
0 parents  commit e3a1105

15 files changed

+53
-0
lines changed

__pycache__/app.cpython-310.pyc

583 Bytes
Binary file not shown.

__pycache__/wsgi.cpython-310.pyc

210 Bytes
Binary file not shown.

app.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from flask import Flask
2+
3+
from rest.index import index_app
4+
5+
def create_app():
6+
app = Flask(__name__)
7+
app.register_blueprint(index_app)
8+
return app
9+
10+
def main():
11+
app = create_app()
12+
app.run(debug=True)
13+
14+
if __name__ == "__main__":
15+
main()

rest/__init__.py

Whitespace-only changes.
173 Bytes
Binary file not shown.
177 Bytes
Binary file not shown.

rest/index/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__all__ = ("index_app")
2+
from .views import index_app
238 Bytes
Binary file not shown.
248 Bytes
Binary file not shown.
458 Bytes
Binary file not shown.
564 Bytes
Binary file not shown.

rest/index/views.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from flask import Blueprint, render_template
2+
3+
index_app = Blueprint('index_app', __name__)
4+
5+
app = index_app
6+
7+
@app.route('/', endpoint='index')
8+
def index_view():
9+
return render_template('index.html')
10+

templates/base.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>
6+
{% block title %}
7+
{% endblock %}
8+
</title>
9+
</head>
10+
<body>
11+
{% block body %}
12+
{% endblock %}
13+
</body>
14+
</html>

templates/index.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "base.html" %}
2+
3+
{% block title %}
4+
Index page
5+
{% endblock %}
6+
7+
{% block body %}
8+
Hello user
9+
{% endblock body %}

wsgi.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from app import create_app
2+
3+
app = create_app()

0 commit comments

Comments
 (0)