-
-
Save Collinslenjo/294afa4a6a56252b8aa8bcec998f69b3 to your computer and use it in GitHub Desktop.
Revisions
-
cedbeu revised this gist
May 22, 2013 . No changes.There are no files selected for viewing
-
cedbeu revised this gist
May 22, 2013 . 2 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes. -
cedbeu revised this gist
May 22, 2013 . 3 changed files with 32 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,23 @@ #!/usr/bin/python # coding: utf-8 """ Filename: __init__.py Purpose: This file is required to structure the web service as a package, to be able to define routes in multiple modules. This is the most basic design pattern for multiple files Flask apps: http://flask.pocoo.org/docs/patterns/packages/ Requirements: Author: Cédric Beuzit """ from flask import Flask app = Flask(__name__) # application wide global variables and config parameters must be defined here # (not in `run.py`) for being able to import them in the beginning of the # views files but we can perfectly imagine a smarter config procedure app.config['HELLO_WORLD'] = 'Hello Flask!' # The views modules that contain the application's routes are imported here # Importing views modules MUST BE in the end of the file to avoid problems # related to circular imports http://flask.pocoo.org/docs/patterns/packages import webapp.views 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,17 @@ #!/usr/bin/python # coding: utf-8 """ Filename: views.py Purpose: This file is one of the views file that can contain the routes for the application Requirements: Author: Cédric Beuzit """ from webapp import app # importing application wide parameters and global variables that have been # defined in __init__.py message = app.config['HELLO_WORLD'] @app.route('/') def webapp(): return message 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,10 @@ #!/usr/bin/python # coding: utf-8 """ Filename: run.py Purpose: This file runs the Flask application service Requirements: Flask Author: Cédric Beuzit """ from webapp import app if __name__ == '__main__': -
cedbeu revised this gist
May 17, 2013 . No changes.There are no files selected for viewing
-
cedbeu revised this gist
May 17, 2013 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,5 @@ #!/usr/bin/python # coding: utf-8 from flask import Flask app = Flask(__name__) -
cedbeu revised this gist
May 17, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ #!/usr/bin/python # coding: utf-8 from flask import Flask app = Flask(__name__) -
cedbeu revised this gist
May 17, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ #!/usr/bin/python #coding: utf-8 from flask import Flask app = Flask(__name__) -
cedbeu revised this gist
May 17, 2013 . No changes.There are no files selected for viewing
-
cedbeu revised this gist
May 17, 2013 . No changes.There are no files selected for viewing
-
cedbeu revised this gist
May 17, 2013 . No changes.There are no files selected for viewing
-
cedbeu created this gist
May 17, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ #!/usr/bin/python # coding: utf-8 from flask import Flask app = Flask(__name__) import webapp.views 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ #!/usr/bin/python # coding: utf-8 from webapp import app @app.route('/') def webapp(): return 'Hello World' 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ #!/usr/bin/python # coding: utf-8 from webapp import app if __name__ == '__main__': app.run(debug=True)