mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 07:01:36 +01:00
support flask runner
This commit is contained in:
11
README.md
11
README.md
@@ -7,6 +7,17 @@ The Open Web Leaderboard is a leaderboard that can easily be used with any backe
|
||||
|
||||
The system was developed to be used with the [skillbird-framwork](https://github.com/FAUSheppy/skillbird). If you use this framework, the program should be working without any arguments. If you need more conductibility feel free to open a pull-request or send me a message.
|
||||
|
||||
# How to run
|
||||
You can run the leaderboard as a flask standalone (arguments overwrite *config.py* settings!):
|
||||
|
||||
./server.py --skillbird-db PATH_TO_DB
|
||||
|
||||
or with a runner like *waitress*:
|
||||
|
||||
/usr/bin/waitress-serve --host 127.0.0.1 --port 5002 --call 'app:createApp
|
||||
|
||||
the *DB_PATH* is set in *config.py* in this case.
|
||||
|
||||
# Preview
|
||||

|
||||
|
||||
|
||||
@@ -5,9 +5,14 @@ import argparse
|
||||
import flask_caching as fcache
|
||||
import json
|
||||
import database as db
|
||||
import os
|
||||
|
||||
|
||||
app = flask.Flask("open-leaderboard")
|
||||
|
||||
if os.path.isfile("config.py"):
|
||||
app.config.from_object("config")
|
||||
|
||||
cache = fcache.Cache(app, config={'CACHE_TYPE': 'simple'})
|
||||
cache.init_app(app)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user