{% extends 'layout.html' %}
{% block content %}
<h3>Change Password</h3>
<form class="" action="/change-password" method="post">
  <div class="form-group">
    <label for="oldpw">Current Password</label>
    <input class="form-control" type="password" id="oldpw" name="oldpw">
  </div>
  <div class="form-group">
    <label for="newpw1">New Password</label>
    <input class="form-control" type="password" id="newpw1" name="newpw1">
  </div>
  <div class="form-group">
    <label for="newpw2">Confirm New Password</label>
    <input class="form-control" type="password" id="newpw2" name="newpw2">
  </div>
  <button class="btn btn-warning" type="submit">Change Password</button>
</form>
{% endblock %}

{% extends 'layout.html' %}
{% block content %}
<h3>Change Password</h3>
<form class="" action="{{url_for('change_password')}}" method="post">
  <div class="form-group">
    <label for="oldpw">Current Password</label>
    <input class="form-control" type="password" id="oldpw" name="oldpw">
  </div>
  <div class="form-group">
    <label for="newpw1">New Password</label>
    <input class="form-control" type="password" id="newpw1" name="newpw1">
  </div>
  <div class="form-group">
    <label for="newpw2">Confirm New Password</label>
    <input class="form-control" type="password" id="newpw2" name="newpw2">
  </div>
  <button class="btn btn-warning" type="submit">Change Password</button>
</form>
{% endblock %}

Use url_for in change password form
Use url_for in change password form
