update
This commit is contained in:
parent
44d8561ed0
commit
9ad821a28e
|
@ -1,8 +1,11 @@
|
||||||
from flask import Flask, render_template
|
from flask import Flask
|
||||||
from flask_bootstrap import Bootstrap
|
from config import config
|
||||||
from flask_moment import Moment
|
|
||||||
|
|
||||||
|
|
||||||
def create_app(config_name):
|
def create_app(config_name):
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
app.config.from_object(config[config_name])
|
||||||
|
from .main import main as main_blueprint
|
||||||
|
app.register_blueprint(main_blueprint)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
|
|
||||||
main = Blueprint('main', __name__)
|
main = Blueprint('main', __name__)
|
||||||
|
|
||||||
|
from . import views, errors
|
||||||
|
|
0
app/main/errors.py
Normal file
0
app/main/errors.py
Normal file
7
app/main/views.py
Normal file
7
app/main/views.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
from . import main
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
@main.route('/', methods=['GET', 'POST'])
|
||||||
|
def index():
|
||||||
|
return json.dumps({'Message': 'Hello, world'})
|
Loading…
Reference in New Issue
Block a user