mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
24
serve.py
24
serve.py
@@ -1,6 +1,24 @@
|
||||
from CTFd import create_app, socketio
|
||||
from CTFd import create_app
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--profile", help="Enable flask_profiler profiling", action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
app = create_app()
|
||||
# app.run(debug=True, threaded=True, host="127.0.0.1", port=4000)
|
||||
|
||||
socketio.run(app, debug=True, host="127.0.0.1", port=4000)
|
||||
if args.profile:
|
||||
import flask_profiler
|
||||
app.config["flask_profiler"] = {
|
||||
"enabled": app.config["DEBUG"],
|
||||
"storage": {
|
||||
"engine": "sqlite"
|
||||
},
|
||||
"basicAuth": {
|
||||
"enabled": False,
|
||||
},
|
||||
}
|
||||
flask_profiler.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