-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
executable file
·40 lines (34 loc) · 1.17 KB
/
main.py
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
37
38
39
40
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""plik główny całej aplikacji."""
# importy modułów py
from flask import Flask
# importy nasze
from views import pages
from views_admin import pages_admin
from views_ajax import pages_ajax
from views_login_system import pages_log_sys, login_manager
from views_user import pages_user
from mail_sending import mail
from db_models import db
from config import DB, APP, EMAIL
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = DB.PATH
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = DB.TRACK_MODIFICATIONS
app.config['SECRET_KEY'] = APP.APP_KEY
app.config['MAIL_SERVER'] = EMAIL.SERVER
app.config['MAIL_PORT'] = EMAIL.PORT
app.config['MAIL_USE_SSL'] = EMAIL.SSL
app.config['MAIL_USERNAME'] = EMAIL.USERNAME
app.config['MAIL_PASSWORD'] = EMAIL.PASSWORD
app.config['MAIL_DEFAULT_SENDER'] = EMAIL.DEFAULT_SENDER
app.register_blueprint(pages)
app.register_blueprint(pages_admin)
app.register_blueprint(pages_ajax)
app.register_blueprint(pages_log_sys)
app.register_blueprint(pages_user)
login_manager.init_app(app)
mail.init_app(app)
db.init_app(app)
if __name__ == '__main__':
app.run(host=APP.IP, port=APP.PORT, debug=APP.DEBUG)