from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals


def url_for(request, endpoint, **values):
    return request.url_adapter.build(endpoint, values)

from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals


def url_for(request, endpoint, **values):
    force_external = values.pop("_force_external", False)
    return request.url_adapter.build(
        endpoint, values,
        force_external=force_external,
    )

Make it possible to force an external url with the url_for helper
Make it possible to force an external url with the url_for helper

  from __future__ import absolute_import, division, print_function
  from __future__ import unicode_literals
  
  
  def url_for(request, endpoint, **values):
+     force_external = values.pop("_force_external", False)
-     return request.url_adapter.build(endpoint, values)
+     return request.url_adapter.build(
+         endpoint, values,
+         force_external=force_external,
+     )
  
Make it possible to force an external url with the url_for helper
## Code Before:
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals


def url_for(request, endpoint, **values):
    return request.url_adapter.build(endpoint, values)

## Instruction:
Make it possible to force an external url with the url_for helper
## Code After:
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals


def url_for(request, endpoint, **values):
    force_external = values.pop("_force_external", False)
    return request.url_adapter.build(
        endpoint, values,
        force_external=force_external,
    )
