aboutsummaryrefslogtreecommitdiff
path: root/runserver.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2020-04-06 23:05:31 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2020-04-06 23:05:31 +0200
commit49b199c610bb32d0581d771d856b3e3332707f17 (patch)
tree9e9c633d5d77bf3ae56395d8cd732ce20dba6b43 /runserver.py
parentAdded a link to the documentation in the about page. (diff)
downloadnewspipe-49b199c610bb32d0581d771d856b3e3332707f17.tar.gz
newspipe-49b199c610bb32d0581d771d856b3e3332707f17.tar.bz2
newspipe-49b199c610bb32d0581d771d856b3e3332707f17.zip
Migrate form Flask-Script to the built-in integration of the click command line interface of Flask.
Diffstat (limited to 'runserver.py')
-rwxr-xr-xrunserver.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/runserver.py b/runserver.py
index b3f02823..2fe093f0 100755
--- a/runserver.py
+++ b/runserver.py
@@ -22,6 +22,15 @@ from flask import g
from flask_restful import Api
from newspipe.bootstrap import application
+from newspipe import commands
+
+
+def register_commands(app):
+ """Register Click commands."""
+ app.cli.add_command(commands.db_empty)
+ app.cli.add_command(commands.db_create)
+ app.cli.add_command(commands.fetch_asyncio)
+ app.cli.add_command(commands.create_admin)
with application.app_context():
@@ -42,6 +51,8 @@ with application.app_context():
application.register_blueprint(views.bookmarks_bp)
application.register_blueprint(views.bookmark_bp)
+ register_commands(application)
+
if __name__ == "__main__":
application.run(
bgstack15