import bcrypt from os import environ from flask import Flask, render_template, url_for, flash, redirect, request, session from flask_mysqldb import MySQL, MySQLdb from flask import jsonify, json from forms import RegistrationForm from flask.ext.ldap import LDAP app = Flask(__name__) users = list(range(100)) app.config['LDAP_HOST'] = 'ldap.example.com' app.config['LDAP_DOMAIN'] = 'example.com' app.config['LDAP_SEARCH_BASE'] = 'OU=Domain Users,DC=example,DC=com' ldap = LDAP(app) app.config[ 'SECRET_KEY'] = '584bd72428c13cfb572da08954dd5944de5a4219ad2b79eaadbee5bcefa19b14' app_on = os.getenv("APP_URL") home_on = os.getenv("HOME_PORT") vendor_on = os.getenv("VENDOR_PORT") invoice_on = os.getenv("INVOICE_PORT") purchase_on = os.getenv("PURCHASE_PORT") trainer_on = os.getenv("TRAINER_PORT") db_host = os.getenv("DB_HOST") home_url = (app_on) + ":" + (home_on) vendor_url = str(app_on) + ":" + str(vendor_on) invoice_url = str(app_on) + ":" + str(invoice_on)
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy # from flask.ext.pagedown import PageDown from flask.ext.mail import Mail from flask.ext.login import LoginManager from flask.ext.ldap import LDAP from settings import settings from lib.common.logo import logo from lib.core.startup import check_configs, check_version, init_modules # pagedown = PageDown() mail = Mail() db = SQLAlchemy() ldap = LDAP() login_manager = LoginManager() login_manager.login_view = 'auth.login' def create_app(config): logo() check_configs() check_version() init_modules() # create_structure() # Define the WSGI application object app = Flask(__name__) # Configurations