-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
36 lines (26 loc) · 651 Bytes
/
app.py
File metadata and controls
36 lines (26 loc) · 651 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""Main app."""
from flask import Flask
from dotenv import load_dotenv
from config import BaseConfig
from blueprints.page import page
from extensions import csrf, mail
def create_app():
"""
Create a Flask application using the app factory pattern.
:return: Flask app
"""
app = Flask(__name__)
load_dotenv()
app.config.from_object(BaseConfig)
app.register_blueprint(page)
register_extensions(app)
return app
def register_extensions(app):
"""
Register extensions.
:param app: Flask application instance
:return: None
"""
csrf.init_app(app)
mail.init_app(app)
return None