v1_api.register(FacilityResource()) v1_api.register(InstrumentResource()) for app_name, app in get_tardis_apps(): try: app_api = import_module('%s.api' % app) for res_name in dir(app_api): if not res_name.endswith('AppResource'): continue resource = getattr(app_api, res_name) if not issubclass(resource, Resource): continue resource_name = resource._meta.resource_name if not resource_name.startswith(app_name): resource._meta.resource_name = '%s_%s' % ( format_app_name_for_url(app_name), resource_name) v1_api.register(resource()) except ImportError as e: logger.debug('App API URLs import error: %s' % str(e)) api_urls = [ url(r'^', include(v1_api.urls)) ] tastypie_swagger_urls = [ url(r'v1/swagger/', include('tastypie_swagger.urls', namespace='api_v1_tastypie_swagger'), kwargs={ "tastypie_api_module": v1_api, "namespace": "api_v1_tastypie_swagger", "version": "1"}
v1_api.register(FacilityResource()) v1_api.register(InstrumentResource()) for app_name, app in get_tardis_apps(): try: app_api = import_module('%s.api' % app) for res_name in dir(app_api): if not res_name.endswith('AppResource'): continue resource = getattr(app_api, res_name) if not issubclass(resource, Resource): continue resource_name = resource._meta.resource_name if not resource_name.startswith(app_name): resource._meta.resource_name = '%s_%s' % ( format_app_name_for_url(app_name), resource_name) v1_api.register(resource()) except ImportError as e: logger.debug('App API URLs import error: %s' % str(e)) api_urls = [url(r'^', include(v1_api.urls))] tastypie_swagger_urls = [ url(r'v1/swagger/', include('tastypie_swagger.urls', namespace='api_v1_tastypie_swagger'), kwargs={ "tastypie_api_module": v1_api, "namespace": "api_v1_tastypie_swagger", "version": "1" }), ]
'_default_view': IndexView.as_view(), '_site_mappings': getattr(settings, 'INDEX_VIEWS', {}) }, name='tardis.tardis_portal.views.index'), url(r'^login/$', site_routed_view, { '_default_view': login, '_site_mappings': getattr(settings, 'LOGIN_VIEWS', {}) }, name='tardis.tardis_portal.views.login') ] app_urls = [] for app_name, app in get_tardis_apps(): app_urls += [ url(r'^%s/' % format_app_name_for_url(app_name), include('%s.urls' % app)) ] urlpatterns = [ url(r'', include(core_urls)), # API views url(r'^api/', include(api_urls)), # tastypie_swagger endpoints for API auto-documentation url(r'^api/', include(tastypie_swagger_urls)), # Experiment Views url(r'^experiment/', include(experiment_urls)),
overridable_urls = [ url(r'^$', site_routed_view, {'_default_view': IndexView.as_view(), '_site_mappings': getattr(settings, 'INDEX_VIEWS', {})}, name='tardis.tardis_portal.views.index'), url(r'^login/$', site_routed_view, {'_default_view': login, '_site_mappings': getattr(settings, 'LOGIN_VIEWS', {})}, name='tardis.tardis_portal.views.login') ] app_urls = [] for app_name, app in get_tardis_apps(): app_urls += [ url(r'^%s/' % format_app_name_for_url(app_name), include('%s.urls' % app)) ] urlpatterns = [ url(r'', include(core_urls)), # API views url(r'^api/', include(api_urls)), # tastypie_swagger endpoints for API auto-documentation url(r'^api/', include(tastypie_swagger_urls)), # Experiment Views url(r'^experiment/', include(experiment_urls)),
v1_api.register(InstrumentResource()) # App API additions for app_name, app in get_tardis_apps(): try: app_api = import_module('%s.api' % app) for res_name in dir(app_api): if not res_name.endswith('AppResource'): continue resource = getattr(app_api, res_name) if not issubclass(resource, Resource): continue resource_name = resource._meta.resource_name if not resource_name.startswith(app_name): resource._meta.resource_name = '%s_%s' % ( format_app_name_for_url(app_name), resource_name) v1_api.register(resource()) except ImportError as e: logger.debug('App API URLs import error: %s' % str(e)) api_urls = patterns( '', (r'^', include(v1_api.urls)), ) tastypie_swagger_urls = patterns( '', url(r'v1/swagger/', include('tastypie_swagger.urls', namespace='api_v1_tastypie_swagger'), kwargs={
v1_api.register(InstrumentResource()) # App API additions for app_name, app in get_tardis_apps(): try: app_api = import_module('%s.api' % app) for res_name in dir(app_api): if not res_name.endswith('AppResource'): continue resource = getattr(app_api, res_name) if not issubclass(resource, Resource): continue resource_name = resource._meta.resource_name if not resource_name.startswith(app_name): resource._meta.resource_name = '%s_%s' % ( format_app_name_for_url(app_name), resource_name) v1_api.register(resource()) except ImportError as e: logger.debug('App API URLs import error: %s' % str(e)) api_urls = patterns( '', (r'^', include(v1_api.urls)), ) tastypie_swagger_urls = patterns( '', url(r'v1/swagger/', include('tastypie_swagger.urls', namespace='api_v1_tastypie_swagger'), kwargs={ "tastypie_api_module": v1_api,