def handle_review_answer(): """ To review a answer, return reviewanswer.review(x) should be called from the controller deciding wich answer to review, this url handles storing the reviews in the database (given a user has permission to do so) """ ReviewAnswer(request) ctrler = Index() return ctrler.render()
def launch(): ctrler = Index(debug=True) return ctrler.render()
def home(): ctrler = Index() return ctrler.render()
def has_new_question(): ctrler = Index() return ctrler.has_new_question()
def student_question(): ctrlr = Index() return ctrlr.student_question(request)
def get_student_questions(): ctrlr = Index() return ctrlr.student_question(request)
def launch(): ctrler = Index(request) return ctrler.render()
def home(): ctrler = Index(request) return ctrler.render()
from flask import Flask, render_template, redirect, request app = Flask(__name__, template_folder="views") # Import Controllers from controllers.hobbys import Hobbys hobby = Hobbys() from controllers.index import Index index = Index() # Routes @app.route('/') def Index(): return index.index() @app.route('/hobbys') def hobbysIndex(): return hobby.index() @app.route('/add_user', methods=['POST']) def add_user(): newUser = { 'first_name': request.form['fname'], 'last_name': request.form['lname'], } return index.add_user(newUser) @app.route('/delete/<id>')
#main.py import config from flask import Flask from controllers.index import Index from controllers.login import Login from controllers.dashboard.dashboard import Dashboard app = Flask(__name__) app.secret_key = config.vdict['secret_key'] Index.register(app, route_base='/') Login.register(app, route_base='/login') Dashboard.register(app, route_base='/dashboard') if __name__ == '__main__': app.run(debug=True)
#main.py import os from controllers.index import Index from controllers.login import Login app = Index() login = Login() app.mount('/login', login) if 'DYNO' in os.environ: app.run(host='0.0.0.0', port=os.environ.get('PORT', 8000)) else: app.run(host='localhost', port=8000, debug=True, reloader=True)