Coder Social home page Coder Social logo

stefanw / django-tastypie-swagger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from concentricsky/django-tastypie-swagger

0.0 1.0 0.0 413 KB

An adapter to use swagger-ui with django-tastypie

License: BSD 2-Clause "Simplified" License

Python 9.63% CSS 18.45% JavaScript 71.92%

django-tastypie-swagger's Introduction

WARNING: This package is ultra young and still needs a lot of work

Synopsis

django-tastypie-swagger is a small adapter library to construct Swagger documentation from Tastypie resources.

This package provides two things:

  1. An embedded instance of Swagger UI to point a URL to.
  2. Automatic Resource Listing and API Declaration generation that is consumed by #1

Usage

Install package:

pip install django-tastypie-swagger

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    ...

    'tastypie_swagger',

    ...
]

Define TASTYPIE_SWAGGER_API_MODULE in your settings. It should be a python path to your instance of tastypie.api.Api:

TASTYPIE_SWAGGER_API_MODULE = 'mainsite.urls.api'

Include in your urlconf with namespace tastypie_swagger:

urlpatterns = patterns('',
    ...

    url(r'api/doc/', include('tastypie_swagger.urls', namespace='tastypie_swagger')),

    ...
)

Swagger documentation will be served up at the URL you configured.

Detecting required fields

Tastypie 0.9.11 ModelResource fields do not respect the blank attribute on django model fields, which this library depends on to determine if a field is required or not.

You can use this ModelResource subclass as a workaround to this issue.

django-tastypie-swagger's People

Contributors

minism avatar johnraz avatar wolever avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.