from flask import render_template, jsonify
from app import app
import random



@app.route('/')
@app.route('/index')
def index():
    # Feature flags init goes here!

    #

    # noinspection PyDictCreation
    flags = {
        "welcome_text": "welcome to my python FF tutorial!"
    }
    # Flag goes here!
    
    #

    flags["alternate_homescreen"] = False
    return render_template(
        'index.html',
        **flags,
        title='Home'
    )


@app.route('/map')
def map():
    return render_template('map.html', title='Map')


@app.route('/map/refresh', methods=['POST'])
def map_refresh():
    points = [(random.uniform(48.8434100, 48.8634100),
               random.uniform(2.3388000, 2.3588000))
              for _ in range(random.randint(2, 9))]
    return jsonify({'points': points})


@app.route('/contact')
def contact():
    return render_template('contact.html', title='Contact')

[((81, 95), 'app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (90, 95), False, 'from app import app\n'), ((97, 116), 'app.app.route', 'app.route', (['"""/index"""'], {}), "('/index')\n", (106, 116), False, 'from app import app\n'), ((461, 478), 'app.app.route', 'app.route', (['"""/map"""'], {}), "('/map')\n", (470, 478), False, 'from app import app\n'), ((545, 588), 'app.app.route', 'app.route', (['"""/map/refresh"""'], {'methods': "['POST']"}), "('/map/refresh', methods=['POST'])\n", (554, 588), False, 'from app import app\n'), ((810, 831), 'app.app.route', 'app.route', (['"""/contact"""'], {}), "('/contact')\n", (819, 831), False, 'from app import app\n'), ((375, 427), 'flask.render_template', 'render_template', (['"""index.html"""'], {'title': '"""Home"""'}), "('index.html', **flags, title='Home')\n", (390, 427), False, 'from flask import render_template, jsonify\n'), ((501, 541), 'flask.render_template', 'render_template', (['"""map.html"""'], {'title': '"""Map"""'}), "('map.html', title='Map')\n", (516, 541), False, 'from flask import render_template, jsonify\n'), ((779, 806), 'flask.jsonify', 'jsonify', (["{'points': points}"], {}), "({'points': points})\n", (786, 806), False, 'from flask import render_template, jsonify\n'), ((858, 906), 'flask.render_template', 'render_template', (['"""contact.html"""'], {'title': '"""Contact"""'}), "('contact.html', title='Contact')\n", (873, 906), False, 'from flask import render_template, jsonify\n'), ((623, 657), 'random.uniform', 'random.uniform', (['(48.84341)', '(48.86341)'], {}), '(48.84341, 48.86341)\n', (637, 657), False, 'import random\n'), ((678, 708), 'random.uniform', 'random.uniform', (['(2.3388)', '(2.3588)'], {}), '(2.3388, 2.3588)\n', (692, 708), False, 'import random\n'), ((745, 765), 'random.randint', 'random.randint', (['(2)', '(9)'], {}), '(2, 9)\n', (759, 765), False, 'import random\n')]