示例#1
0
文件: app.py 项目: Gooeydev/cms-poc
def index():
    if request.headers.get("Authorization") is None:
        return redirect(
            "http://be.contentful.com/oauth/authorize?response_type=token&client_id=74223773b0811faf2028cb0b5a3197c5a07729a3b7db30d7eac6ac6add470da4&redirect_uri=http://127.0.0.1:5000/reentry&scope=content_management_manage"
        )

    client = ContentfulClient()
    message = client.get_message("5TZLutAXJewIqSakAu8SuY")
    return render_template("index.html", message=message)
示例#2
0
文件: app.py 项目: Gooeydev/cms-poc
def get_messages():
    client = ContentfulClient()
    messages = client.get_messages()
    return ModelSerializer.serialize_list(messages)
示例#3
0
文件: app.py 项目: Gooeydev/cms-poc
def get_templates():
    client = ContentfulClient()
    templates = client.get_templates()
    return ModelSerializer.serialize_list(templates)
示例#4
0
文件: app.py 项目: Gooeydev/cms-poc
def get_blueprints():
    client = ContentfulClient()
    blueprints = client.get_blueprints()
    return ModelSerializer.serialize_list(blueprints)