Turn your Django project into RESTFul APIs in a minute.
Project description
django-restify
django-restify
requires django-rest-framework
. It will create RESTFul endpoints for all models that are enabled in your project.
Installation
pip install django_restify
Uses
Install django-rest-framework and django_restify.
Activate
django-rest-framework
anddjango_restify
by adding it inINSTALLED_APP
of your django settingsINSTALLED_APP = ( 'django.contrib.auth', (...), 'rest_framework', 'django_restify' )
Configure
urls.py
:Import
django_restify.router:
from django_restify.restify import router
Configure URL:
urlpatterns = [ url(r'^admin/', include(admin.site.urls)), (.......), url(r'^api/v1/', include(router.urls)), ]
Settings
RESTIFY = {
'IGNORE_LIST': []
'USER_VIEWSET': '',
'NEW_USER_ACTIVE': True,
'SERIALIZERS': {
'model': {},
},
'VIEWSETS': {
'entry': {},
}
}
IGNORE_LIST
The modules to be ignored (in list format). It can accept regular expression. For example, the default ignore list looks like:
[‘^django*’, ‘^api$’, ‘^rest_framework*’, ‘^auth*’]
USER_VIEWSET
To use custom viewset for user model
NEW_USER_ACTIVE
Set new registered user as active.
SERIALIZERS
To use custom serializers for a model. It should be in dictionary format e.g. {‘model’: ‘package.serializers.ModelSerializer’
VIEWSETS
To use custom viewsets for a model. It should be dictionary format e.g. {‘model’: ‘package.viewsets.ModelViewSet’
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.