mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Use Flask blueprints for modularisation, per Khushboo Vashi.
This commit is contained in:
@@ -9,6 +9,3 @@
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
from flask import Module
|
||||
|
||||
module = Module(__name__, 'utils')
|
||||
|
||||
@@ -10,14 +10,17 @@
|
||||
##########################################################################
|
||||
|
||||
import config
|
||||
from utils import module
|
||||
from flask import Blueprint
|
||||
from time import time, ctime
|
||||
|
||||
# Initialise the module
|
||||
blueprint = Blueprint('utils', __name__)
|
||||
|
||||
##########################################################################
|
||||
# A test page
|
||||
##########################################################################
|
||||
@module.route("/test")
|
||||
def index():
|
||||
@blueprint.route("/test")
|
||||
def test():
|
||||
|
||||
output = """
|
||||
Today is <b>%s</b>
|
||||
@@ -31,6 +34,6 @@ Today is <b>%s</b>
|
||||
##########################################################################
|
||||
# A special URL used to "ping" the server
|
||||
##########################################################################
|
||||
@module.route("/ping")
|
||||
@blueprint.route("/ping")
|
||||
def ping():
|
||||
return "PING"
|
||||
|
||||
Reference in New Issue
Block a user