mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-15 23:16:48 +00:00
add param support
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
from datetime import datetime
|
||||
import click
|
||||
from flask import Flask, render_template
|
||||
from flask.cli import with_appcontext
|
||||
@@ -19,6 +20,7 @@ def create_app(config_name=None):
|
||||
register_blueprints(app)
|
||||
register_extensions(app)
|
||||
register_errors(app)
|
||||
register_context_processors(app)
|
||||
register_cli(app)
|
||||
|
||||
return app
|
||||
@@ -48,6 +50,13 @@ def register_errors(app):
|
||||
return render_template('errors/500.html'), 500
|
||||
|
||||
|
||||
def register_context_processors(app):
|
||||
@app.context_processor
|
||||
def inject_date_now():
|
||||
now = datetime.utcnow()
|
||||
return {'now': now}
|
||||
|
||||
|
||||
def register_cli(app):
|
||||
@app.cli.command()
|
||||
@with_appcontext
|
||||
|
||||
Reference in New Issue
Block a user