@@ -14,8 +14,12 @@ This class acts as a central registry for a significant amount of a Flask
1414application's functionality, including URL rounting,
1515[ template configurations] ( /template-engines.html ) , and handling view functions.
1616
17+ <a href =" /flask-app-badrequest-examples.html " >BadRequest</a >,
18+ <a href =" /flask-app-headers-examples.html " >Headers</a >,
19+ and <a href =" /flask-app-immutabledict-examples.html " >ImmutableDict</a >
20+ are several other callables with code examples from the same ` flask.app ` package.
1721
18- These subjects go along with the ` Flask ` code examples:
22+ You should read up on these subjects along with these ` Flask ` examples:
1923
2024* [ web development] ( /web-development.html ) and [ web design] ( /web-design.html )
2125* [ Flask] ( /flask.html ) and [ web framework] ( /web-frameworks.html ) concepts
@@ -75,7 +79,52 @@ def new_checkout():
7579```
7680
7781
78- ## Example 2 from Flask AppBuilder
82+ ## Example 2 from CTFd
83+ [ CTFd] ( https://github.com/CTFd/CTFd )
84+ ([ homepage] ( https://ctfd.io/ ) ) is a
85+ [ capture the flag (CTF) hacking web app] ( https://cybersecurity.att.com/blogs/security-essentials/capture-the-flag-ctf-what-is-it-for-a-newbie )
86+ built with [ Flask] ( /flask.html ) . The application can be used
87+ as-is to run CTF events, or modified for custom rules for related
88+ scenarios. CTFd is open sourced under the
89+ [ Apache License 2.0] ( https://github.com/CTFd/CTFd/blob/master/LICENSE ) .
90+
91+ [ ** CTFd / manage.py** ] ( https://github.com/CTFd/CTFd/blob/master/././manage.py )
92+
93+ ``` python
94+ # manage.py
95+ ~~ from flask import Flask
96+ from flask_sqlalchemy import SQLAlchemy
97+ from flask_script import Manager
98+ from flask_migrate import Migrate, MigrateCommand
99+ from CTFd import create_app
100+ from CTFd.utils import get_config as get_config_util, set_config as set_config_util
101+ from CTFd.models import *
102+
103+ app = create_app()
104+
105+ manager = Manager(app)
106+ manager.add_command(" db" , MigrateCommand)
107+
108+
109+ def jsenums ():
110+ from CTFd.constants import JS_ENUMS
111+ import json
112+ import os
113+
114+ path = os.path.join(app.root_path, " themes/core/assets/js/constants.js" )
115+
116+ with open (path, " w+" ) as f:
117+ for k, v in JS_ENUMS .items():
118+ f.write(" const {} = Object.freeze({} );" .format(k, json.dumps(v)))
119+
120+
121+
122+ # # ... source file continues with no further Flask examples...
123+
124+ ```
125+
126+
127+ ## Example 3 from Flask AppBuilder
79128[ Flask-AppBuilder] ( https://github.com/dpgaspar/Flask-AppBuilder )
80129([ documentation] ( https://flask-appbuilder.readthedocs.io/en/latest/ )
81130and
@@ -138,7 +187,7 @@ class OAuthRegistrationRoleTestCase(unittest.TestCase):
138187```
139188
140189
141- ## Example 3 from FlaskBB
190+ ## Example 4 from FlaskBB
142191[ FlaskBB] ( https://github.com/flaskbb/flaskbb )
143192([ project website] ( https://flaskbb.org/ ) ) is a [ Flask] ( /flask.html ) -based
144193forum web application. The web app allows users to chat in an open
@@ -237,7 +286,7 @@ def configure_app(app, config):
237286```
238287
239288
240- ## Example 4 from flask-base
289+ ## Example 5 from flask-base
241290[ flask-base] ( https://github.com/hack4impact/flask-base )
242291([ project documentation] ( http://hack4impact.github.io/flask-base/ ) )
243292provides boilerplate code for new [ Flask] ( /flask.html ) web apps.
@@ -316,7 +365,7 @@ def create_app(config):
316365```
317366
318367
319- ## Example 5 from flask-bones
368+ ## Example 6 from flask-bones
320369[ flask-bones] ( https://github.com/cburmeister/flask-bones )
321370([ demo] ( http://flask-bones.herokuapp.com/ ) )
322371is large scale [ Flask] ( /flask.html ) example application built
@@ -378,7 +427,7 @@ def create_app(config=config.base_config):
378427```
379428
380429
381- ## Example 6 from flask-bookshelf
430+ ## Example 7 from flask-bookshelf
382431[ flask-bookshelf] ( https://github.com/damyanbogoev/flask-bookshelf ) is the
383432example [ Flask] ( /flask.html ) application that developers create when
384433going through
@@ -430,7 +479,7 @@ def get_lang_code(endpoint, values):
430479```
431480
432481
433- ## Example 7 from flaskex
482+ ## Example 8 from flaskex
434483[ Flaskex] ( https://github.com/anfederico/Flaskex ) is a working example
435484[ Flask] ( /flask.html ) web application intended as a base to build your
436485own applications upon. The application comes with pre-built sign up, log in
@@ -483,7 +532,7 @@ def logout():
483532```
484533
485534
486- ## Example 8 from Flask-HTTPAuth
535+ ## Example 9 from Flask-HTTPAuth
487536[ Flask-HTTPAuth] ( https://github.com/miguelgrinberg/Flask-HTTPAuth )
488537([ documentation] ( https://flask-httpauth.readthedocs.io/en/latest/ )
489538and
@@ -539,7 +588,7 @@ class HTTPAuthTestCase(unittest.TestCase):
539588```
540589
541590
542- ## Example 9 from flask-phone-input
591+ ## Example 10 from flask-phone-input
543592[ flask-phone-input] ( https://github.com/miguelgrinberg/flask-phone-input )
544593is an example application that ties together the
545594[ intTellInput.js] ( https://github.com/jackocnr/intl-tel-input )
@@ -591,7 +640,7 @@ def index():
591640```
592641
593642
594- ## Example 10 from flaskSaaS
643+ ## Example 11 from flaskSaaS
595644[ flaskSaas] ( https://github.com/alectrocute/flaskSaaS ) is a boilerplate
596645starter project to build a software-as-a-service (SaaS) web application
597646in [ Flask] ( /flask.html ) , with [ Stripe] ( /stripe.html ) for billing. The
@@ -640,7 +689,7 @@ from app.models import User
640689```
641690
642691
643- ## Example 11 from Flask-SocketIO
692+ ## Example 12 from Flask-SocketIO
644693[ Flask-SocketIO] ( https://github.com/miguelgrinberg/Flask-SocketIO )
645694([ PyPI package information] ( https://pypi.org/project/Flask-SocketIO/ ) ,
646695[ official tutorial] ( https://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent )
@@ -751,7 +800,7 @@ if __name__ == '__main__':
751800```
752801
753802
754- ## Example 12 from Flask-User
803+ ## Example 13 from Flask-User
755804[ Flask-User] ( https://github.com/lingthio/Flask-User )
756805([ PyPI information] ( https://pypi.org/project/Flask-User/ )
757806and
@@ -834,7 +883,7 @@ class UserManager(UserManager__Settings, UserManager__Utils, UserManager__Views)
834883```
835884
836885
837- ## Example 13 from Flask-VueJs-Template
886+ ## Example 14 from Flask-VueJs-Template
838887[ Flask-VueJs-Template] ( https://github.com/gtalarico/flask-vuejs-template )
839888([ demo site] ( https://flask-vuejs-template.herokuapp.com/ ) )
840889is a minimal [ Flask] ( /flask.html ) boilerplate starter project that
@@ -875,7 +924,7 @@ def index_client():
875924```
876925
877926
878- ## Example 14 from Flasky
927+ ## Example 15 from Flasky
879928[ Flasky] ( https://github.com/miguelgrinberg/flasky ) is a wonderful
880929example application by
881930[ Miguel Grinberg] ( https://github.com/miguelgrinberg ) that he builds
@@ -939,7 +988,7 @@ def create_app(config_name):
939988```
940989
941990
942- ## Example 15 from Datadog Flask Example App
991+ ## Example 16 from Datadog Flask Example App
943992The [ Datadog Flask example app] ( https://github.com/DataDog/trace-examples/tree/master/python/flask )
944993contains many examples of the [ Flask] ( /flask.html ) core functions
945994available to a developer using the [ web framework] ( /web-frameworks.html ) .
@@ -1000,7 +1049,7 @@ def before_request():
10001049```
10011050
10021051
1003- ## Example 16 from keras-flask-deploy-webapp
1052+ ## Example 17 from keras-flask-deploy-webapp
10041053The
10051054[ keras-flask-deploy-webapp] ( https://github.com/mtobeiyf/keras-flask-deploy-webapp )
10061055project combines the [ Flask] ( /flask.html ) [ web framework] ( /web-frameworks.html )
@@ -1064,7 +1113,7 @@ def model_predict(img, model):
10641113```
10651114
10661115
1067- ## Example 17 from sandman2
1116+ ## Example 18 from sandman2
10681117[ sandman2] ( https://github.com/jeffknupp/sandman2 )
10691118([ project documentation] ( https://sandman2.readthedocs.io/en/latest/ )
10701119and
@@ -1145,7 +1194,7 @@ def get_app(
11451194```
11461195
11471196
1148- ## Example 18 from Science Flask
1197+ ## Example 19 from Science Flask
11491198[ Science Flask] ( https://github.com/danielhomola/science_flask )
11501199is a [ Flask] ( /flask.html ) -powered web application for online
11511200scientific research tools. The project was built as a template
@@ -1214,7 +1263,7 @@ def create_celery_app():
12141263```
12151264
12161265
1217- ## Example 19 from tedivms-flask
1266+ ## Example 20 from tedivms-flask
12181267[ tedivm's flask starter app] ( https://github.com/tedivm/tedivms-flask ) is a
12191268base of [ Flask] ( /flask.html ) code and related projects such as
12201269[ Celery] ( /celery.html ) which provides a template to start your own
@@ -1343,7 +1392,7 @@ def create_app(extra_config_settings={}):
13431392```
13441393
13451394
1346- ## Example 20 from trape
1395+ ## Example 21 from trape
13471396[ trape] ( https://github.com/jofpin/trape ) is a research tool for tracking
13481397people's activities that are logged digitally. The tool uses
13491398[ Flask] ( /flask.html ) to create a web front end to view aggregated data
0 commit comments