Created
January 20, 2012 19:22
-
-
Save mgax/1649105 to your computer and use it in GitHub Desktop.
Flask application template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import flask | |
| import flaskext.script | |
| default_config = { | |
| } | |
| def create_app(): | |
| import views | |
| app = flask.Flask(__name__, instance_relative_config=True) | |
| app.config.update(default_config) | |
| app.config.from_pyfile('settings.py', silent=True) | |
| views.register_on(app) | |
| return app | |
| manager = flaskext.script.Manager(create_app) | |
| if __name__ == '__main__': | |
| manager.run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Flask==0.9 | |
| Flask-Script==0.4 | |
| Jinja2==2.6 | |
| Werkzeug==0.8.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import flask | |
| views = flask.Blueprint('views', __name__) | |
| @views.route('/') | |
| def index(): | |
| return "hello world!" | |
| def register_on(app): | |
| app.register_blueprint(views) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment