Example #1
0
# Hash Key
app.config["SECRET_KEY"] = "REMEMBER TO CHANGE THIS USE ENVIRONMENT VARS"

# SQLAlchemy
app.config["SQLALCHEMY_DATABASE_URI"] = "mysql+pymysql://root:openflow@localhost:3306/smp"
app.config["SQLALCHEMY_COMMIT_ON_TEARDOWN"] = True


# Email
app.config["MAIL_SERVER"] = "michaelangelo.zuver.net.au"
app.config["MAIL_PORT"] = 465
app.config["MAIL_USE_SSL"] = True
app.config["MAIL_USERNAME"] = "sdn@petertriho.com"  # os.environ.get('MAIL_USERNAME')
app.config["MAIL_PASSWORD"] = "sdnpass#2015"  # os.environ.get('MAIL_PASSWORD')
app.config["MAIL_SUBJECT_PREFIX"] = "[reSiDeNce] "
app.config["MAIL_SENDER"] = "reSiDeNce Admin <sdn@petertriho.com>"

# ------------#
# Extensions #
# ------------#
db = SQLAlchemy(app)
api = Api(app)
auth = HTTPBasicAuth()
mail = Mail(app)


@app.after_request
def after_request(response):
    response.headers.add("Access-Control-Allow-Origin", "*")
    response.headers.add("Access-Control-Allow-Headers", "Content-Type, Authorization")
Example #2
0
File: app.py Project: angcbi/flaskr

app = Flask(__name__)
app.config["SECRET_KEY"] = "skdfjodglksdgjower"
app.config["SQLALCHEMY_DATABASE_URI"] = "mysql+pymysql://test3:test3@localhost:3306/test3"
app.config["SQLALCHEMY_COMMIT_ON_TEARDOWN"] = True
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True

app.config["MAIL_SERVER"] = "smtp.qq.com"
app.config["MAIL_PORT"] = 465
app.config["MAIL_USE_SSL"] = True
app.config["MAIL_USE_TLS"] = False
app.config["MAIL_USERNAME"] = "faladihuan@qq.com"
app.config["MAIL_PASSWORD"] = "vxclhkigrzfjibgf"

app.config["MAIL_SUBJECT_PREFIX"] = "[Admin]"
app.config["MAIL_SENDER"] = "Admin <faladihuan@qq.com>"
app.config["ADMIN"] = "836268808@qq.com"

app.config["REDIS_URL"] = "redis://:123456@localhost:6379/0"

manager = Manager(app)
bootstrap = Bootstrap(app)
moment = Moment(app)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
manager.add_command("db", MigrateCommand)
mail = Mail(app)
redis_store = FlaskRedis(app)