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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for xyz_restful-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7acd4fcdc285fd10c6ea797823ced7be04a46a44df0efc7202ed3ea3d278f150 |
|
MD5 | 75001490322cf566ab9358a519a58fea |
|
BLAKE2b-256 | 411c1f3cf32834169084a7d700c3ea11dcf4dfdddcc9b0b77bf00445c5013d48 |
Close
Hashes for xyz_restful-0.1.8-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 764714bcc7f3b940a48030aadc41b7070fa2774cc1fc14ecf8adf49f9fd0a50f |
|
MD5 | 1378ddacf93cd69c5b2f92996ce835cf |
|
BLAKE2b-256 | d89ff63191b09a94c6be316af6c67dde686ed237d454b097aaa75cf85bd5c9aa |