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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xyz_restful-0.3.2-py3-none-any.whl.
File metadata
- Download URL: xyz_restful-0.3.2-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
feb2470166696eb9954316b42ca8b26521af68d3f5a0793e69b2b3566974be9c
|
|
| MD5 |
3dd42ad9c0f1669a39b551fe77889c96
|
|
| BLAKE2b-256 |
83e7e96014f41e444b6b046647d5d6d1640d96d2773d3eb148f29daf56454a02
|