diff --git a/colab/plugins/urls.py b/colab/plugins/urls.py index b84ebaf..e2c7d0e 100644 --- a/colab/plugins/urls.py +++ b/colab/plugins/urls.py @@ -17,5 +17,5 @@ for app_name, app in settings.COLAB_APPS.items(): raise ImproperlyConfigured(undef_url_include_msg) urlpatterns += patterns('', url(urls.get('prefix', r''), include(urls['include'], - namespace=urls.get('namespace'))), + namespace=urls.get('namespace')), name=app_name), ) diff --git a/colab/proxy/context_processors.py b/colab/proxy/context_processors.py index 38fa709..658a91b 100644 --- a/colab/proxy/context_processors.py +++ b/colab/proxy/context_processors.py @@ -1,12 +1,12 @@ from django.apps import apps +from django.conf import settings def proxied_apps(request): proxied_apps = {} - for app in apps.get_app_configs(): - if getattr(app, 'colab_proxied_app', False): - proxied_apps[app.label] = app + for app_name, app in settings.COLAB_APPS.items(): + proxied_apps[app_name] = app return {'proxy': proxied_apps} diff --git a/colab/proxy/templatetags/proxy.py b/colab/proxy/templatetags/proxy.py index 9b83a34..e2251bf 100644 --- a/colab/proxy/templatetags/proxy.py +++ b/colab/proxy/templatetags/proxy.py @@ -22,14 +22,16 @@ def proxy_menu(context): menu_links = {} proxied_apps = context.get('proxy', {}) - for app in proxied_apps.values(): - if not hasattr(app, 'menu'): + for app_name, app in proxied_apps.items(): + print app + if not app.get('menu'): continue - title = app.menu.get('title', app.label.title()) - links = app.menu.get('links', tuple()) + menu = app.get('menu') + title = menu.get('title', app_name) + links = menu.get('links', tuple()).items() if context['user'].is_active: - links += app.menu.get('auth_links', tuple()) + links += menu.get('auth_links', tuple()).items() if not links: continue @@ -38,8 +40,7 @@ def proxy_menu(context): menu_links[title] = [] for text, link in links: - url = reverse(app.label, args=(link,)) - menu_links[title].append((text, url)) + menu_links[title].append((text, link)) menu = render_to_string('proxy/menu_template.html', {'menu_links': menu_links}) diff --git a/colab/settings.py b/colab/settings.py index 784d025..39025eb 100644 --- a/colab/settings.py +++ b/colab/settings.py @@ -287,7 +287,6 @@ CONVERSEJS_BOSH_SERVICE_URL = SITE_URL + '/http-bind' CONVERSEJS_ALLOW_CONTACT_REQUESTS = False CONVERSEJS_SHOW_ONLY_ONLINE_USERS = True - # Tastypie settings TASTYPIE_DEFAULT_FORMATS = ['json', ] @@ -317,8 +316,8 @@ for app_label in PROXIED_APPS.keys(): COLAB_APPS = locals().get('COLAB_APPS') or {} -for app in COLAB_APPS: - INSTALLED_APPS += (app,) +for app_name, app in COLAB_APPS.items(): + INSTALLED_APPS += (app_name,) if not app or 'templates' not in app: continue @@ -326,6 +325,6 @@ for app in COLAB_APPS: template = app.get('templates') if template.get('staticdir'): - STATICFILES_DIRS += template.get('staticdir') + STATICFILES_DIRS += (template.get('staticdir'),) if template.get('templatesdir'): - TEMPLATE_DIRS += template.get('templatesdir') + TEMPLATE_DIRS += (template.get('templatesdir'),) -- libgit2 0.21.2