Exemplo n.º 1
0
def page(page_url):
    """Generic Page View"""
    profile = Profile()
    profile.database = db
    profile.load_admin()
    
    page = Page("/%s" % page_url)
    page.database = db
    try:
        page.load()
    except PageNotFound:
        abort(404)
    html = markdown.markdown(page.content)
    
    return render_template('page.html', page=page, html=html, profile=profile)
Exemplo n.º 2
0
def index():
    """Home page of the profile"""
    profile = Profile()
    profile.database = db
    try:
        profile.load_admin()
    except AdminNotFound:
        return redirect(url_for("installation_index"))
    page = Page("/")
    page.database = db
    try:
        page.load()
    except PageNotFound:
        abort(500)
    html = markdown.markdown(page.content)
    return render_template('homepage.html', html=html, profile=profile)