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')

[((7, 1, 7, 15), 'app.app.route', 'app.route', ({(7, 11, 7, 14): '"""/"""'}, {}), "('/')", False, 'from app import app\n'), ((8, 1, 8, 20), 'app.app.route', 'app.route', ({(8, 11, 8, 19): '"""/index"""'}, {}), "('/index')", False, 'from app import app\n'), ((30, 1, 30, 18), 'app.app.route', 'app.route', ({(30, 11, 30, 17): '"""/map"""'}, {}), "('/map')", False, 'from app import app\n'), ((35, 1, 35, 44), 'app.app.route', 'app.route', (), '', False, 'from app import app\n'), ((43, 1, 43, 22), 'app.app.route', 'app.route', ({(43, 11, 43, 21): '"""/contact"""'}, {}), "('/contact')", False, 'from app import app\n'), ((23, 11, 27, 5), 'flask.render_template', 'render_template', (), '', False, 'from flask import render_template, jsonify\n'), ((32, 11, 32, 51), 'flask.render_template', 'render_template', (), '', False, 'from flask import render_template, jsonify\n'), ((40, 11, 40, 38), 'flask.jsonify', 'jsonify', ({(40, 19, 40, 37): "{'points': points}"}, {}), "({'points': points})", False, 'from flask import render_template, jsonify\n'), ((45, 11, 45, 59), 'flask.render_template', 'render_template', (), '', False, 'from flask import render_template, jsonify\n'), ((37, 15, 37, 53), 'random.uniform', 'random.uniform', ({(37, 30, 37, 40): '(48.84341)', (37, 42, 37, 52): '(48.86341)'}, {}), '(48.84341, 48.86341)', False, 'import random\n'), ((38, 15, 38, 51), 'random.uniform', 'random.uniform', ({(38, 30, 38, 39): '(2.3388)', (38, 41, 38, 50): '(2.3588)'}, {}), '(2.3388, 2.3588)', False, 'import random\n'), ((39, 29, 39, 49), 'random.randint', 'random.randint', ({(39, 44, 39, 45): '(2)', (39, 47, 39, 48): '(9)'}, {}), '(2, 9)', False, 'import random\n')]