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!

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 py3

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

Uploaded py2

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page