Example #1
0
def setup():
    app = Flask(__name__)
    app.config["CSRF_ENABLED"] = False
    app.secret_key = "1"
    admin = Admin(app)

    return app, admin
def setup():
    connect("superadmin_test")
    app = Flask(__name__)
    app.config["SECRET_KEY"] = "1"
    app.config["CSRF_ENABLED"] = False

    admin = Admin(app)

    return app, admin
def setup():
    app = Flask(__name__)
    app.config["SECRET_KEY"] = "1"
    app.config["CSRF_ENABLED"] = False
    app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///"

    db = SQLAlchemy(app)
    admin = Admin(app)

    return app, db, admin
Example #4
0
def setup():
    app = Flask(__name__)
    app.config["SECRET_KEY"] = "1"
    app.config["CSRF_ENABLED"] = False
    app.config["MONGODB_SETTINGS"] = {"DB": "tests"}

    db = MongoEngine()
    db.init_app(app)

    admin = Admin(app)

    return app, db, admin
Example #5
0
# -*- coding: utf-8 -*-
import os

from flask import Flask, render_template, url_for, redirect, jsonify
from flask import request, abort, Response, flash
from flask import make_response

from werkzeug import Headers


app = Flask(__name__)
app.config["CSRF_ENABLED"] = False
app.config["SECRET_KEY"] = "asecret"


@app.route("/")
def home():
    return render_template("home.html")


@app.route("/no-cache")
def no_cahce():
    response = make_response("No cache for me.", 200)
    response.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
    return response


@app.route("/alert")
def alert():
    return render_template("alert.html")
Example #6
0
import os

from flask import Flask
from flask_appbuilder import AppBuilder, SQLA

app = Flask(__name__)

basedir = os.path.abspath(os.path.dirname(__file__))
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + os.path.join(basedir, "app.db")
app.config["CSRF_ENABLED"] = True
app.config["SECRET_KEY"] = "thisismyscretkey"

db = SQLA(app)
appbuilder = AppBuilder(app, db.session)

app.run(host="0.0.0.0", port=8080, debug=True)