I have a django application, with a module called "app"
Now this module has a file called "urls.py" which has a variable called "HOME_URL"
What I'm trying to do ?
app_label = "app" url = __import__(app_label).urls.HOME_URL print url
That obviously doesn't work, but I hope you got what I'm trying to do, If not please comment I will edit the question to contain more info.
You can use
import_module to load a module relative to the root of a django project.
from django.utils.importlib import import_module
app_label = "app"
url = import_module("%s.urls" % app_label).HOME_URL
This should work within your django project, or in