"""Butternut URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Add an import: from blog import urls as blog_urls 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin from tastypie.api import Api from api import UserResource, ProfileResource import views v1_api = Api(api_name='v1') v1_api.register(UserResource(),canonical=True) v1_api.register(ProfileResource(),canonical=True) urlpatterns = [ url('^', views.AccountView.as_view()), ]
from django.conf.urls import patterns, include, url from tastypie.api import Api from lisa.server.web.manageplugins.api import PluginResource, IntentResource from lisa.server.web.interface.api import WidgetResource, WorkspaceResource, WidgetByUserResource from api import LisaResource, UserResource from twisted.python.reflect import namedAny import tastypie_swagger v1_api = Api(api_name='v1') v1_api.register(UserResource()) v1_api.register(PluginResource()) v1_api.register(IntentResource()) v1_api.register(WorkspaceResource()) v1_api.register(WidgetResource()) v1_api.register(WidgetByUserResource()) v1_api.register(LisaResource()) urlpatterns = patterns( '', url(r'^speech/', include('lisa.server.web.googlespeech.urls')), url(r'^plugins/', include('lisa.server.web.manageplugins.urls')), url(r'', include('lisa.server.web.interface.urls')), ) #Register plugin's API from lisa.server.plugins.PluginManager import PluginManager for plugin in PluginManager.getEnabledPluginNames(): urlpatterns += patterns( '', url(r'^' + str(plugin) + r'/', include('lisa.plugins.' + str(plugin) + '.web.urls')))
#Fichero llamado urls.py situado en directorio server from django.conf.urls import patterns, url, include from django.contrib import admin admin.autodiscover() from tastypie.api import Api # modulo webservices from api import UserResource # clase en api.py con informacion sobre url import views user_api = Api(api_name='v1') # v1 es una etiqueta para identificar el recurso user_api.register(UserResource()) # registrar api.UserResource user_resource = UserResource() urlpatterns = patterns( '', url(r'^$', views.index, name='index'), url(r'^add_user/$', views.add_user, name='add_user'), url(r'^login/$', views.login, name='login'), url(r'^api/', include(user_api.urls) ), # agnadir los urls contenidas en api.Userresource.prepend_urls )
''' Created on Nov 30, 2016 @author: theo ''' from django.conf.urls import url, include from api import MetingResource, UserResource, SensorResource, UserProfileDataResource from django.contrib import admin from tastypie.api import Api from views import home from . import views from django.conf.urls.static import static from django.conf import settings v1 = Api(api_name='v1') v1.register(MetingResource()) v1.register(UserResource()) v1.register(SensorResource()) v1.register(UserProfileDataResource()) urlpatterns = [ url(r'^$', home), url(r'^admin/', include(admin.site.urls)), url(r'^api/', include(v1.urls)), url(r'^getusers/', views.getusers), url(r'^getpoints/', views.getpoints), url(r'^getseries/', views.getseries), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import patterns, url, include from api import UserResource user_resource = UserResource() urlpatterns = patterns('', url(r'^auth/', include(user_resource.urls)), (r'^users/edit/change-user-role-service/?$', 'api.views.change_user_role_service'), (r'^networks/edit/change-network-member/?$', 'api.views.change_network_member'), url(r'^get_ccs/?$', 'api.views.get_ccs'))