On 18 May 22:30, Andy Doan wrote:
> This adds the ability to expose a REST API based on the Django REST
> framework project. Since this project isn't packaged in most current
> distributions, we ensure that its both installed and enabled before
> trying to use it.
> 
> Signed-off-by: Andy Doan <[email protected]>
> Inspired-by: Damien Lespiau <[email protected]>
> Reviewed-by: Stephen Finucane <[email protected]>

Reviewed-by still valid and suggestion for future work below.

Stephen

> +if settings.ENABLE_REST_API:
> +    if 'rest_framework' not in settings.INSTALLED_APPS:
> +        raise RuntimeError(
> +            'djangorestframework must be installed to enable the REST API.')
> +    import patchwork.views.rest_api
> +    urlpatterns += [
> +        url(r'^api/1.0/', include(patchwork.views.rest_api.router.urls)),
> +    ]

Future work item: alias 'api' to the latest version ('api/1.0', at the
moment)?
_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork

Reply via email to