'module' object has no attribute 'urlpatterns'

8 views
Skip to first unread message

abhijeet shete

unread,
Oct 28, 2013, 9:50:40 AM10/28/13
to django-users
Hi Folks,

    I have developed one app say "XYZ" and I am using it in my django project as symblik link. 
I am trying to access urlpatterns in urls.py module from django project in my "XYZ" app as

    from django.conf import settings
  from importlib import import_module
    
  root_urls = import_module(settings.ROOT_URLCONF)
     
  url_patterns = root_urls.urlpatterns


But I am getting this error

    'module' object has no attribute 'urlpatterns'


. My qustion is how can I access urlpatterns from django project in my "XYZ" app. I can't directly import urls module from django project in my app because it is independent or I don't have direct access to urls module.


Any help will be highly appreciated. Thanks in advance.

Thanks and Regards.
Abhijeet Shete
Reply all
Reply to author
Forward
0 new messages