Skip to main content

restful utils

Project description

XYZ RestFul API provides a way to register django-rest-framework apis as easy as Django admins.

Usage Example

First, add ‘xyz_restful’ into django settings’s INSTALLED_APPS

INSTALLED_APPS = [
    ...
    'xyz_restful',
    ...
]

Then, register url router in project’s "urls.py"

from xyz_restful.helper import router

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^api/', include(router.urls)),
    ...
]

Then, in an app for example: comment , create a file "comment/apis.py"

from xyz_restful.decorators import register

@register()
class PostViewSet(viewsets.ModelViewSet):
    serializer_class = serializers.PostSerializer
    queryset = models.Post.objects.all()

then, full api url just like : http://127.0.0.1:8000/api/comment/post/

Enjoyed!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

xyz_restful-0.1.3-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

xyz_restful-0.1.3-py2-none-any.whl (8.8 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page