How to Solve NameError: name 'url_for' is not defined -- ckan

Solution: Import the 'url_for' module

# Add the following line to the top of your code
from ckan.lib.helpers import url_for

 

For more information:
ckan url_for