本文整理汇总了Python中tastypie.api.NamespacedApi._canonicals方法的典型用法代码示例。如果您正苦于以下问题:Python NamespacedApi._canonicals方法的具体用法?Python NamespacedApi._canonicals怎么用?Python NamespacedApi._canonicals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tastypie.api.NamespacedApi
的用法示例。
在下文中一共展示了NamespacedApi._canonicals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: NamespacedApi
# 需要导入模块: from tastypie.api import NamespacedApi [as 别名]
# 或者: from tastypie.api.NamespacedApi import _canonicals [as 别名]
# /user
# /user/archives
# /user/folders
# /user/organizations
# /user/capture_jobs
v1_api.register(CurrentUserResource())
v1_api.register(CurrentUserLinkResource())
v1_api.register(CurrentUserFolderResource())
v1_api.register(CurrentUserOrganizationResource())
v1_api.register(CurrentUserCaptureJobResource())
### v1a ###
v1a_api = NamespacedApi(api_name='v1a', urlconf_namespace='v1a')
v1a_api._registry = v1_api._registry.copy()
v1a_api._canonicals = v1_api._canonicals.copy()
### add API versions to urlpatters ###
urlpatterns = v1_api.urls + v1a_api.urls + collateral_urls
### error handlers ###
def handler404(request):
HttpResponse(status=404)
def handler500(request):
HttpResponse(status=500)
### django debug toolbar ###
if settings.DEBUG and hasattr(settings, 'DEBUG_TOOLBAR_CONFIG'):