Add skeleton run command
This commit is contained in:
parent
eb0ca027a9
commit
81ec200928
|
@ -0,0 +1,7 @@
|
||||||
|
from flask import Flask, render_template
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def root():
|
||||||
|
return render_template("admin.html", username="guest")
|
|
@ -65,6 +65,13 @@ def command_init(args):
|
||||||
os.mkdir(os.path.join(cfd, "lexicon"))
|
os.mkdir(os.path.join(cfd, "lexicon"))
|
||||||
os.mkdir(os.path.join(cfd, "user"))
|
os.mkdir(os.path.join(cfd, "user"))
|
||||||
|
|
||||||
|
@add_argument("-a", "--address", default="127.0.0.1")
|
||||||
|
@add_argument("-p", "--port", default="5000")
|
||||||
|
def command_run(args):
|
||||||
|
"""Runs the default Flask development server"""
|
||||||
|
from app import app
|
||||||
|
app.run(host=args.address, port=args.port)
|
||||||
|
|
||||||
@add_argument("--foo", action="store_true")
|
@add_argument("--foo", action="store_true")
|
||||||
def command_dump(args):
|
def command_dump(args):
|
||||||
"""Dumps the global config or the config for the given lexicon"""
|
"""Dumps the global config or the config for the given lexicon"""
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<h1>Hello, {{username}}</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue