LoginSignup
4
4

More than 5 years have passed since last update.

FlaskでBlueprintを使ってControllerを別に分けてみる

Last updated at Posted at 2012-03-16

server.py

app = Flask(name, static_folder='webapp/static', template_folder='webapp/templates')
from webapp.views.news import news_app
app.register_blueprint(news_app)

webapp.views.news.py

news_app = Blueprint('news', name)

@news_app.route('/')
def index():
return 'Hello World in news controller'

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4