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 Distribution

xyz_restful-0.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file xyz_restful-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: xyz_restful-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for xyz_restful-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59acfdbd0c8809e7f0189d3f91aecc1a6c07e232b1a45729fa226137c595f4e4
MD5 c3d959b051498ef4c8f3c11e8de43260
BLAKE2b-256 ec44223895bd0550582145bd46151d0ab8c69a962c53016676f5193ec9656038

See more details on using hashes here.

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