38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
##########################################################################
|
|
#
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
#
|
|
# Copyright (C) 2013 - 2014, The pgAdmin Development Team
|
|
# This software is released under the PostgreSQL Licence
|
|
#
|
|
##########################################################################
|
|
|
|
"""A blueprint module implementing the core pgAdmin browser."""
|
|
MODULE_NAME = 'browser'
|
|
|
|
import config
|
|
from flask import Blueprint, current_app, render_template
|
|
from flaskext.gravatar import Gravatar
|
|
from flask.ext.security import login_required
|
|
from flask.ext.login import current_user
|
|
|
|
# Initialise the module
|
|
blueprint = Blueprint(MODULE_NAME, __name__, static_folder='static', static_url_path='', template_folder='templates', url_prefix='/' + MODULE_NAME)
|
|
|
|
##########################################################################
|
|
# A test page
|
|
##########################################################################
|
|
@blueprint.route("/")
|
|
@login_required
|
|
def index():
|
|
"""Render and process the main browser window."""
|
|
gravatar = Gravatar(current_app,
|
|
size=100,
|
|
rating='g',
|
|
default='retro',
|
|
force_default=False,
|
|
use_ssl=False,
|
|
base_url=None)
|
|
|
|
return render_template('index.html', username=current_user.email)
|