[Answered ]-Dynamically import url in Django gives 'str' object is not callable

2👍

url is a function defined in from django.conf.urls. However the following line in your code overwrites this variable and stores a string there.

url = module.get_url()

change this variable to something else, eg:

url_route = module.get_url()
urlpatterns.append(url(r'^%s/' % url_route, include('%s.urls' % module.name), name = module.name))

Leave a comment