Пример #1
0
def create_app():
    app = Flask(__name__, template_folder='templates')
    app.config['SECRET_KEY'] = 'hjb,n'
    app.config['MAIL_DEBUG'] = MAIL_DEBUG
    app.config['MAIL_SERVER'] = MAIL_SERVER
    app.config['MAIL_PORT'] = MAIL_PORT
    app.config['MAIL_USE_TLS'] = MAIL_USE_TLS
    app.config['MAIL_USE_SSL'] = MAIL_USE_SSL
    app.config['MAIL_USERNAME'] = MAIL_USERNAME
    app.config['MAIL_PASSWORD'] = MAIL_PASSWORD
    app.config['MAIL_DEFAULT_SENDER'] = MAIL_DEFAULT_SENDER
    mail = Mail(app)
    toastr = Toastr(app)
    return app
Пример #2
0
# App config and database init
db = SQLAlchemy()

# Password hashing
bcrypt = Bcrypt()

# Login config
login_manager = LoginManager()
login_manager.login_view = 'users.login'
login_manager.login_message_category = 'info'

# Json data loading and config
json_data = os.path.join(Config.SITE_ROOT, "static/data", "tokensData.json")
token_data = json.load(open(json_data))

toastr = Toastr()


def create_app(config_class=Config):
    """ app creation - set template folder and init app and blueprints"""

    app = Flask(__name__, template_folder='templates')
    app.config.from_object(Config)

    db.init_app(app)
    heroku.init_app(app)
    bcrypt.init_app(app)
    login_manager.init_app(app)
    toastr.init_app(app)

    from app.users.routes import users
Пример #3
0
# from aquaLite import *
import datetime
import json
import sqlite3
import time
import statistics as stat
import mail
from config import credential
import generator
from flask_toastr import Toastr  # toastr module import
import create_database

app = Flask(__name__)

# python notification toaster
toastr = Toastr(app)

# Set the secret_key on the application to something unique and secret.
app.config['SECRET_KEY'] = '5791628bb0b13ce0c676dfde280ba245'


# home route....landing page
@app.route("/", methods=['GET', 'POST'])
@app.route("/index", methods=["GET", "POST"])
def index():
    print("landing page running...")
    if request.method == 'POST':
        username = request.form['username']
        passwd = request.form['password']

        # credentials from config files imported
Пример #4
0
def register_feature(app):
    CSRFProtect(app)
    MongoEngine(app)
    toastr = Toastr(app)