Skip to main content

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

  1. Install django-rest-framework and django_restify.

  2. Activate django-rest-framework and django_restify by adding it in INSTALLED_APP of your django settings

    INSTALLED_APP = (
           'django.contrib.auth',
            (...),
            'rest_framework',
            'django_restify'
    )
    
  3. 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 = {
    'MODELS': [],
    'IGNORE_LIST': [],
    'USER_VIEWSET': '',
    'NEW_USER_ACTIVE': True,
    'SERIALIZERS': {
        'model': {},
    },
    'VIEWSETS': {
        'entry': {},
    }
}

MODELS

The list of models that you want create REST end-point. It will ingnore all other models and create end points models as listed in MODELS. IGNORE_LIST will get higher precedence over MODELS.

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

This version
History Node

0.1.9

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_restify-0.1.9.tar.gz (5.4 kB) Copy SHA256 hash SHA256 Source None Dec 9, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page