def create_app(app=None, config_file=None): if not app: app = Flask(__name__, template_folder="views") # Config files app.config.from_pyfile("config/base.py") if config_file: app.config.from_pyfile("config/{}.py".format(config_file)) # Extensions Foundation(app) admin = Admin(app, name='Bolsa de Trabajo', template_mode='bootstrap3') """ CONTROLADORES """ # Blueprints app.register_blueprint(frontend) # Admin Views admin.add_view(AdminSkillView(Skill, db.session)) admin.add_view(AdminStudentView(Student, db.session)) admin.add_view(AdminCompanyView(Company, db.session)) return app
def create_app(): app = Flask(__name__) Foundation(app) app.config['secret'] = 'mytoughsecret' app.config["FOUNDATION_CDN"] #app.config["FOUNDATION_TEXT_DIRECTION"] = "rtl" @app.route('/') def index(): return render_template('index.html') return app
from flask import Flask, render_template, flash, request, redirect, url_for import redis from flask_wtf import FlaskForm, CsrfProtect from wtforms import * from flask_zurb_foundation import Foundation from flask_classy import FlaskView, route app = Flask(__name__) Foundation(app) app.config['SECRET_KEY'] = 'redis_app' csrf = CsrfProtect() csrf.init_app(app) r = redis.StrictRedis(host='127.0.0.1', port=6379, db=0, charset="utf-8", decode_responses=True) class QuestionForm(FlaskForm): title = StringField('Title Question') question = TextAreaField('Question') author = StringField('Author Name') submit = SubmitField(' ') class ApplicationViews(FlaskView): route_base = '/' @route('/', methods=['GET', 'POST'])
def test_can_initialize_app_and_extesion(): from flask import Flask from flask_zurb_foundation import Foundation app = Flask(__name__) Foundation(app)