settings can be modified in myslice.ini
[unfold.git] / myslice / components.py
1 from django.conf.urls import include, url
2 from myslice.configengine import ConfigEngine
3
4 def list():
5     config = ConfigEngine()
6     return config.myslice.components.split(',')
7
8 def urls():
9     u = []
10     for component in list():
11         try:
12             __import__(component)
13             u.append( url(r'^%s/' % component, include('%s.urls' % component)) )
14         except Exception, e:
15             print "-> Cannot load component (%s): %s" % (component, e)
16         else:
17             print "-> Loaded component %s" % component
18             
19     return u
20