@@ -316,7 +316,69 @@ def create_app(config):
316316```
317317
318318
319- ## Example 5 from flask-bookshelf
319+ ## Example 5 from flask-bones
320+ [ flask-bones] ( https://github.com/cburmeister/flask-bones )
321+ ([ demo] ( http://flask-bones.herokuapp.com/ ) )
322+ is large scale [ Flask] ( /flask.html ) example application built
323+ with [ Blueprints] ( https://flask.palletsprojects.com/en/1.1.x/blueprints/ )
324+ ([ example Blueprint code] ( /flask-blueprints-blueprint-examples.html ) ).
325+ This project is provided as open source under the
326+ [ MIT license] ( https://github.com/cburmeister/flask-bones/blob/master/LICENSE ) .
327+
328+ [ ** flask-bones / app / __ init__ .py** ] ( https://github.com/cburmeister/flask-bones/blob/master/app/./__init__.py )
329+
330+ ``` python
331+ # __init__.py
332+ import time
333+
334+ ~~ from flask import Flask, g, render_template, request
335+ import arrow
336+ import requests
337+
338+ from app import config
339+ from app.assets import assets
340+ from app.auth import auth
341+ from app.commands import create_db, drop_db, populate_db, recreate_db
342+ from app.database import db
343+ from app.extensions import lm, travis, mail, migrate, bcrypt, babel, rq, limiter
344+ from app.user import user
345+ from app.utils import url_for_other_page
346+
347+
348+ def create_app (config = config.base_config):
349+ ~~ app = Flask(__name__ )
350+ app.config.from_object(config)
351+
352+ register_extensions(app)
353+ register_blueprints(app)
354+ register_errorhandlers(app)
355+ register_jinja_env(app)
356+ register_commands(app)
357+
358+ def get_locale ():
359+ return request.accept_languages.best_match(config.SUPPORTED_LOCALES )
360+
361+ if babel.locale_selector_func is None :
362+ babel.locale_selector_func = get_locale
363+
364+ @app.before_request
365+ def before_request ():
366+ g.request_start_time = time.time()
367+ g.request_time = lambda : ' %.5f s' % (time.time() - g.request_start_time)
368+ g.pjax = ' X-PJAX' in request.headers
369+
370+ @app.route (' /' , methods = [' GET' ])
371+ def index ():
372+ return render_template(' index.html' )
373+
374+
375+
376+ # # ... source file continues with no further Flask examples...
377+
378+ ```
379+
380+
381+ ## Example 6 from flask-bookshelf
320382[ flask-bookshelf] ( https://github.com/damyanbogoev/flask-bookshelf ) is the
321383example [ Flask] ( /flask.html ) application that developers create when
322384going through
@@ -368,7 +430,7 @@ def get_lang_code(endpoint, values):
368430```
369431
370432
371- ## Example 6 from flaskex
433+ ## Example 7 from flaskex
372434[ Flaskex] ( https://github.com/anfederico/Flaskex ) is a working example
373435[ Flask] ( /flask.html ) web application intended as a base to build your
374436own applications upon. The application comes with pre-built sign up, log in
@@ -421,7 +483,7 @@ def logout():
421483```
422484
423485
424- ## Example 7 from Flask-HTTPAuth
486+ ## Example 8 from Flask-HTTPAuth
425487[ Flask-HTTPAuth] ( https://github.com/miguelgrinberg/Flask-HTTPAuth )
426488([ documentation] ( https://flask-httpauth.readthedocs.io/en/latest/ )
427489and
@@ -477,7 +539,7 @@ class HTTPAuthTestCase(unittest.TestCase):
477539```
478540
479541
480- ## Example 8 from flask-phone-input
542+ ## Example 9 from flask-phone-input
481543[ flask-phone-input] ( https://github.com/miguelgrinberg/flask-phone-input )
482544is an example application that ties together the
483545[ intTellInput.js] ( https://github.com/jackocnr/intl-tel-input )
@@ -529,7 +591,7 @@ def index():
529591```
530592
531593
532- ## Example 9 from flaskSaaS
594+ ## Example 10 from flaskSaaS
533595[ flaskSaas] ( https://github.com/alectrocute/flaskSaaS ) is a boilerplate
534596starter project to build a software-as-a-service (SaaS) web application
535597in [ Flask] ( /flask.html ) , with [ Stripe] ( /stripe.html ) for billing. The
@@ -578,7 +640,7 @@ from app.models import User
578640```
579641
580642
581- ## Example 10 from Flask-SocketIO
643+ ## Example 11 from Flask-SocketIO
582644[ Flask-SocketIO] ( https://github.com/miguelgrinberg/Flask-SocketIO )
583645([ PyPI package information] ( https://pypi.org/project/Flask-SocketIO/ ) ,
584646[ official tutorial] ( https://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent )
@@ -689,7 +751,7 @@ if __name__ == '__main__':
689751```
690752
691753
692- ## Example 11 from Flask-User
754+ ## Example 12 from Flask-User
693755[ Flask-User] ( https://github.com/lingthio/Flask-User )
694756([ PyPI information] ( https://pypi.org/project/Flask-User/ )
695757and
@@ -772,7 +834,7 @@ class UserManager(UserManager__Settings, UserManager__Utils, UserManager__Views)
772834```
773835
774836
775- ## Example 12 from Flask-VueJs-Template
837+ ## Example 13 from Flask-VueJs-Template
776838[ Flask-VueJs-Template] ( https://github.com/gtalarico/flask-vuejs-template )
777839([ demo site] ( https://flask-vuejs-template.herokuapp.com/ ) )
778840is a minimal [ Flask] ( /flask.html ) boilerplate starter project that
@@ -813,7 +875,7 @@ def index_client():
813875```
814876
815877
816- ## Example 13 from Flasky
878+ ## Example 14 from Flasky
817879[ Flasky] ( https://github.com/miguelgrinberg/flasky ) is a wonderful
818880example application by
819881[ Miguel Grinberg] ( https://github.com/miguelgrinberg ) that he builds
@@ -877,7 +939,7 @@ def create_app(config_name):
877939```
878940
879941
880- ## Example 14 from Datadog Flask Example App
942+ ## Example 15 from Datadog Flask Example App
881943The [ Datadog Flask example app] ( https://github.com/DataDog/trace-examples/tree/master/python/flask )
882944contains many examples of the [ Flask] ( /flask.html ) core functions
883945available to a developer using the [ web framework] ( /web-frameworks.html ) .
@@ -938,7 +1000,7 @@ def before_request():
9381000```
9391001
9401002
941- ## Example 15 from keras-flask-deploy-webapp
1003+ ## Example 16 from keras-flask-deploy-webapp
9421004The
9431005[ keras-flask-deploy-webapp] ( https://github.com/mtobeiyf/keras-flask-deploy-webapp )
9441006project combines the [ Flask] ( /flask.html ) [ web framework] ( /web-frameworks.html )
@@ -1002,7 +1064,7 @@ def model_predict(img, model):
10021064```
10031065
10041066
1005- ## Example 16 from sandman2
1067+ ## Example 17 from sandman2
10061068[ sandman2] ( https://github.com/jeffknupp/sandman2 )
10071069([ project documentation] ( https://sandman2.readthedocs.io/en/latest/ )
10081070and
@@ -1083,7 +1145,7 @@ def get_app(
10831145```
10841146
10851147
1086- ## Example 17 from Science Flask
1148+ ## Example 18 from Science Flask
10871149[ Science Flask] ( https://github.com/danielhomola/science_flask )
10881150is a [ Flask] ( /flask.html ) -powered web application for online
10891151scientific research tools. The project was built as a template
@@ -1152,7 +1214,7 @@ def create_celery_app():
11521214```
11531215
11541216
1155- ## Example 18 from tedivms-flask
1217+ ## Example 19 from tedivms-flask
11561218[ tedivm's flask starter app] ( https://github.com/tedivm/tedivms-flask ) is a
11571219base of [ Flask] ( /flask.html ) code and related projects such as
11581220[ Celery] ( /celery.html ) which provides a template to start your own
@@ -1281,7 +1343,7 @@ def create_app(extra_config_settings={}):
12811343```
12821344
12831345
1284- ## Example 19 from trape
1346+ ## Example 20 from trape
12851347[ trape] ( https://github.com/jofpin/trape ) is a research tool for tracking
12861348people's activities that are logged digitally. The tool uses
12871349[ Flask] ( /flask.html ) to create a web front end to view aggregated data
0 commit comments