from flask import Blueprint, request, jsonify, render_template


bp = Blueprint('views', __name__, url_prefix='')


@bp.route('/ip', methods=['GET'])
def get_ip():
    return jsonify(ip=request.remote_addr)


@bp.route('/', methods=['GET'])
def index():
    return render_template('index.html')

from flask import Blueprint, request, render_template


bp = Blueprint('views', __name__, url_prefix='')


@bp.route('/', methods=['GET'])
def index():
    return render_template('index.html', ip=request.remote_addr)

Remove json route for retrieving the ip.
Remove json route for retrieving the ip.

- from flask import Blueprint, request, jsonify, render_template
+ from flask import Blueprint, request, render_template
  
  
  bp = Blueprint('views', __name__, url_prefix='')
  
  
- @bp.route('/ip', methods=['GET'])
- def get_ip():
-     return jsonify(ip=request.remote_addr)
- 
- 
  @bp.route('/', methods=['GET'])
  def index():
-     return render_template('index.html')
+     return render_template('index.html', ip=request.remote_addr)
  
Remove json route for retrieving the ip.
## Code Before:
from flask import Blueprint, request, jsonify, render_template


bp = Blueprint('views', __name__, url_prefix='')


@bp.route('/ip', methods=['GET'])
def get_ip():
    return jsonify(ip=request.remote_addr)


@bp.route('/', methods=['GET'])
def index():
    return render_template('index.html')

## Instruction:
Remove json route for retrieving the ip.
## Code After:
from flask import Blueprint, request, render_template


bp = Blueprint('views', __name__, url_prefix='')


@bp.route('/', methods=['GET'])
def index():
    return render_template('index.html', ip=request.remote_addr)
