예제 #1
0
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()
예제 #2
0
def launch():
    ctrler = Index(debug=True)
    return ctrler.render()
예제 #3
0
def home():
    ctrler = Index()
    return ctrler.render()
예제 #4
0
def has_new_question():
    ctrler = Index()
    return ctrler.has_new_question()
예제 #5
0
def student_question():
    ctrlr = Index()
    return ctrlr.student_question(request)
예제 #6
0
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()
예제 #9
0
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>')
예제 #10
0
#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)
예제 #11
0
파일: main.py 프로젝트: Sokhavuth/typing
#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)