Skip to main content

A toolkit for Django REST framework to easily switch APIs' naming styles.

Project description

This is a toolkit supporting camel case and snake case APIs’ naming styles and easily switch.

I wrote this with Django 2.0 and Django REST framework 3.7.3, but I think it can easily work with other versions of Django and DRF.


  • Python (2.7+)
  • Django
  • Django REST framework


Install using pip

pip install django-rest-framework-naming-style

Replace renderer and parser classes for JSON in your REST_FRAMEWORK setting

        # 'rest_framework.renderers.JSONRenderer',
        # 'rest_framework.parsers.JSONParser',

Make a monkey patch in django’s

# Make patching before `execute_from_command_line(sys.argv)`
from django_rest_framework_naming_style.monkey import monkey_patch


Optional Settings

There are settings of this package with default value, options.

    'STYLE_KEY': 'STYLE',  # set a header key
    'STYLE_DEFAULT': 'underscore',  # underscore/camelcase

STYLE_KEY that you set accept a value in request headers between underscore and camelcase to specify one naming style of APIs unless you set style in view object to specify it.

If you set STYLE_KEY None, the style only depends on style in view object or STYLE_DEFAULT as you like.

Thank you for using django-rest-framework-naming-style.

Project details

Download files

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

Files for django-rest-framework-naming-style, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size django-rest-framework-naming-style-0.2.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page