mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
Improve caching (#1014)
* Cache get place code for users and teams.
* Fix score changing test helpers to clear standings cache when generating a score changing row
* `utils._get_config` will now return `KeyError` instead of None.
* Separate `/api/v1/[users,teams]/[me,id]/[solves,fails,awards]` into seperate API endpoints
* Install `Flask-DebugToolbar` in development
Main goals covered in #1012
This commit is contained in:
6
serve.py
6
serve.py
@@ -8,6 +8,7 @@ args = parser.parse_args()
|
||||
app = create_app()
|
||||
|
||||
if args.profile:
|
||||
from flask_debugtoolbar import DebugToolbarExtension
|
||||
import flask_profiler
|
||||
app.config["flask_profiler"] = {
|
||||
"enabled": app.config["DEBUG"],
|
||||
@@ -19,6 +20,11 @@ if args.profile:
|
||||
},
|
||||
}
|
||||
flask_profiler.init_app(app)
|
||||
app.config['DEBUG_TB_PROFILER_ENABLED'] = True
|
||||
app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
|
||||
|
||||
toolbar = DebugToolbarExtension()
|
||||
toolbar.init_app(app)
|
||||
print(" * Flask profiling running at http://127.0.0.1:4000/flask-profiler/")
|
||||
|
||||
app.run(debug=True, threaded=True, host="127.0.0.1", port=4000)
|
||||
|
||||
Reference in New Issue
Block a user