import os, json, urllib2
from flask import Flask, render_template, request, make_response
from functools import wraps

from openarticlegauge.view.contact import blueprint as contact
from openarticlegauge.view.query import blueprint as query
from openarticlegauge.view.issue import blueprint as issue
from openarticlegauge.view.lookup import blueprint as lookup

from openarticlegauge.core import app

app.register_blueprint(contact, url_prefix='/contact')
app.register_blueprint(query, url_prefix='/query')
app.register_blueprint(issue, url_prefix='/issue')
app.register_blueprint(lookup, url_prefix='/lookup')


# static front page
@app.route('/')
def hello():
    return render_template('index.html')


# about page with a bit more info
@app.route('/about')
def about():
    return render_template('about.html')


# the info for devs goes here
@app.route("/developers")
Exemple #2
0
from functools import wraps
from flask.ext.login import login_user, current_user
from openarticlegauge.core import app, login_manager
from openarticlegauge import models, plugin

from openarticlegauge.view.contact import blueprint as contact
from openarticlegauge.view.query import blueprint as query
from openarticlegauge.view.issue import blueprint as issue
from openarticlegauge.view.lookup import blueprint as lookup
from openarticlegauge.view.account import blueprint as account
from openarticlegauge.view.admin import blueprint as admin
from openarticlegauge.view.publisher import blueprint as publisher
from openarticlegauge.view.license_statement import blueprint as license_statement
from openarticlegauge.view.resolve_doi import blueprint as resolve_doi

app.register_blueprint(contact, url_prefix='/contact')
app.register_blueprint(publisher, url_prefix='/publisher')
app.register_blueprint(license_statement, url_prefix='/license_statement')
app.register_blueprint(query, url_prefix='/query')
app.register_blueprint(issue, url_prefix='/issue')
app.register_blueprint(account, url_prefix="/account")
app.register_blueprint(admin, url_prefix="/admin")
app.register_blueprint(resolve_doi, url_prefix='/resolve_doi')

# breaks the blueprint abstraction but needed to allow /lookup route
# without trailing slash
from openarticlegauge.view.lookup import api_lookup

# allow POST-ing to /lookup without the trailing slash
# this definition has to come before the lookup blueprint is registered
@app.route('/lookup', methods=['POST'])