Source

bioinformatics.nci.nih.gov / app.py

Full commit
from flask import Flask, url_for
from flask import render_template
from flask_flatpages import FlatPages

from bioinformaticsncinihgov.software import SoftwareList

app = Flask(__name__)

# set up flatpages
app.config.FLATPAGES_ROOT = 'pages'
pages = FlatPages(app)

app.debug = True


@app.route("/")
def hello():
    return render_template('index.html')

@app.route('/software/')
def software_list():
    software = SoftwareList('software.yaml')
    return render_template('software.html',software = software.software)

@app.route('/<path:path>/')
def page(path):
    page = pages.get_or_404(path)
    template = page.meta.get('template', 'index2.html')
    return render_template(template, page=page)


if __name__ == "__main__":
    app.run()