Giter Site home page Giter Site logo

manosim / django-rest-framework-docs Goto Github PK

View Code? Open in Web Editor NEW
644.0 644.0 184.0 4.72 MB

Document Web APIs made with Django Rest Framework

Home Page: https://www.drfdocs.com/

License: BSD 2-Clause "Simplified" License

Python 55.33% HTML 11.32% CSS 7.26% JavaScript 26.09%
django django-rest-framework docs pypi web-api

django-rest-framework-docs's Introduction

Personal Website

Hey, I'm Manos ๐Ÿ‘‹
Engineering Manager at NearForm.

django-rest-framework-docs's People

Contributors

afnarel avatar ambivalentno avatar brobin avatar cyriac avatar ekonstantinidis avatar emadmokhtar avatar limdauto avatar manosim avatar nd-young avatar ninobaldo avatar qiuyingtao avatar rainyday avatar styxman avatar xncbf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-rest-framework-docs's Issues

Django 1.9 incompatibilities

"C:\Program Files (x86)\PyCharm\bin\runnerw.exe" D:\VirtualEnvs\nouvelleoffre\Scripts\python.exe D:/Git/nouvelleoffre-back/manage.py runserver 8000
Traceback (most recent call last):
  File "D:/Git/nouvelleoffre-back/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "D:\VirtualEnvs\nouvelleoffre\lib\site-packages\django\core\management\__init__.py", line 351, in execute_from_command_line
    utility.execute()
  File "D:\VirtualEnvs\nouvelleoffre\lib\site-packages\django\core\management\__init__.py", line 343, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "D:\VirtualEnvs\nouvelleoffre\lib\site-packages\django\core\management\__init__.py", line 177, in fetch_command
    commands = get_commands()
  File "C:\Python34\lib\functools.py", line 448, in wrapper
    result = user_function(*args, **kwds)
  File "D:\VirtualEnvs\nouvelleoffre\lib\site-packages\django\core\management\__init__.py", line 72, in get_commands
    for app_config in reversed(list(apps.get_app_configs())):
  File "D:\VirtualEnvs\nouvelleoffre\lib\site-packages\django\apps\registry.py", line 137, in get_app_configs
    self.check_apps_ready()
  File "D:\VirtualEnvs\nouvelleoffre\lib\site-packages\django\apps\registry.py", line 124, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

Everything works fine when removing "rest_framework_docs" from INSTALLED_APPS.

Thanks.

Muliple line doc strings appearing as one

If we have a class which has multiple line arguments. They appear on the same line. It would be great if we could format the doc string with some markup. Couldn't find anything related to formatting of doc string which is very important for any kind of documentation.

class ProjectList(generics.ListAPIView):
    """
    * API Endpoint for Project List.
    * About API 2nd line:
        1.this is first point.
        2.this is second point. 
    """
    ...

mulipleline_docstring

But when we check it on the docs everything comes up in one line.

api endpoint does not display properly

my drf project layout:

project:
- urls.py
api:

  • urls.py

In project/urls.py I defined the url routing like:

urlpatterns = [url(r'^api/', include('api.urls', namespace='api')),
url(r'^api-token-auth/', views.obtain_token),]

on the drf web page, it gives me api/api-token-auth as the endpoint but it should be api-token-auth/. Hope this issue can be quickly fixed. thanks!

Path for nested `urls.py` files not properly built.

I have a project level nestor/urls.py file like this:

urlpatterns = [
    url(r'^v1/', include('nestor.v1.urls', namespace='api-v1')),
    url(r'^docs/', include('rest_framework_docs.urls', namespace='api-docs')),
]

Then nestor/v1/urls.py like:

router = rest_framework.routers.DefaultRouter()

router.register('node', Node, base_name='node')
router.register('vm', VirtualMachine, base_name='vm')
router.register('ldev', LDev, base_name='ldev')

# BUG: DRFDocs is not picking up the nesting properly
urlpatterns = [
    url(r'^', include(router.urls)),
]

The generated URLs in the doc look like:

/node/
/node/<pk>/
/vm/
/vm/<pk>/
/vm/<pk>/reboot/
/ldev/
/

Clearly, the v1/ prefix is missing. I think the culprit is the recursive part of the endpoint generator:

https://github.com/manosim/django-rest-framework-docs/blob/master/rest_framework_docs/api_docs.py#L27

In that line, the parent_patter that was carried in the recursive call is replaced and not accumulated.

Also, I have the impression that @manosim has stopped working on the package.

Live API csrftoken problem

Hello again,

How has everyone solved the missing csrftoken problem with the liveapi feature? I had to hack the liveapi client to set the X-CSRFTOKEN header by reading from the cookie. I wonder if it's the library's responsibility to do that?

"Read only field" displayed in the post request

1

class MessagesSerializers(serializers.ModelSerializer):
    message = serializers.CharField(min_length=1)
    class Meta:
        model = ChatMessages
        fields = ('message','chat','user','date')
        read_only_fields = ('chat','user')

DocString Formatting for Description

How do I format the description of an endpoint for when DRF Docs displays it? I've tried several things and nothing works. For example, I'd like to add line breaks. Is there a way to do this?
Thanks

Double-slashes in endpoint URLs

I installed drfdocs with the current DRF tutorial code. I noticed these odd URLs listed in the Docs:

//
//snippets/
//snippets/<pk>/highlight/

And others.

This is because of this URL configuration in the project-level urls.py:

urlpatterns = [
...
    url(r'^', include('snippets.urls')),
...
]

drfdocs needs to collapse these slashes into one.

Error when using custom user model

I get the following error on the documentation root page:
ImproperlyConfigured: Field name usernameis not valid for modelCustomUser.

I imagine this has something to do with my custom user model, where I have disabled the username field by setting USERNAME_FIELD = 'email' in the model. The rest API works fine and it is only when setting url(r'^api/v1/', include('rest_framework_docs.urls')), that I get the problem at /api/v1/

The traceback indicates it is coming from the following lines in api_endpoint.py:

fields = [{
                "name": key,
                "type": str(field.__class__.__name__),
                "required": field.required
            } for key, field in serializer().get_fields().items()]

However, I can enter the python shell, get an instance of the serializer and run this code manually just fine. So I'm now at a loss as to what is causing this...

The full traceback is:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
    return self.application(environ, start_response)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 177, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 230, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 289, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "/usr/local/lib/python2.7/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
    six.reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py", line 184, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 157, in get
    context = self.get_context_data(**kwargs)
  File "/usr/local/lib/python2.7/site-packages/rest_framework_docs/views.py", line 17, in get_context_data
    docs = ApiDocumentation()
  File "/usr/local/lib/python2.7/site-packages/rest_framework_docs/api_docs.py", line 21, in __init__
    self.get_all_view_names(root_urlconf.urlpatterns)
  File "/usr/local/lib/python2.7/site-packages/rest_framework_docs/api_docs.py", line 27, in get_all_view_names
    self.get_all_view_names(urlpatterns=pattern.url_patterns, parent_pattern=parent_pattern)
  File "/usr/local/lib/python2.7/site-packages/rest_framework_docs/api_docs.py", line 29, in get_all_view_names
    api_endpoint = ApiEndpoint(pattern, parent_pattern)
  File "/usr/local/lib/python2.7/site-packages/rest_framework_docs/api_endpoint.py", line 19, in __init__
    self.fields = self.__get_serializer_fields__()
  File "/usr/local/lib/python2.7/site-packages/rest_framework_docs/api_endpoint.py", line 54, in __get_serializer_fields__
    } for key, field in serializer().get_fields().items()]
  File "/usr/local/lib/python2.7/site-packages/rest_framework/serializers.py", line 1000, in get_fields
    field_name, info, model, depth
  File "/usr/local/lib/python2.7/site-packages/rest_framework/serializers.py", line 1135, in build_field
    return self.build_unknown_field(field_name, model_class)
  File "/usr/local/lib/python2.7/site-packages/rest_framework/serializers.py", line 1242, in build_unknown_field
    (field_name, model_class.__name__)
ImproperlyConfigured: Field name `username` is not valid for model `CustomUser`.

My serializer:

class CustomUserSerializer(serializers.ModelSerializer):
    client_profile = ClientProfileSerializer(required=False)
    instructor_profile = InstructorProfileSerializer(required=False)
    lookup_field = 'slug'

    class Meta:
        model = models.CustomUser
        fields = '__all__'

My model:

class OffPeaksUser(auth_models.AbstractBaseUser, auth_models.PermissionsMixin):
    '''Custom user model
    '''
    objects = UserManager()
    # Fields
    email = models.EmailField(max_length=255, unique=True)
    first_name = models.CharField(max_length=20)
    last_name = models.CharField(max_length=20)
    slug = models.SlugField(max_length=200, unique=True, null=True)
    profile_image = models.ImageField(blank=True, null=True)
    title = models.CharField(max_length=10, blank=True, null=True)
    biography = models.TextField(blank=True, null=True)
    newsletter = models.BooleanField(default=False)

    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['first_name', 'last_name']

Schema support in REST framework 3.4

Just a quick note to mention that I've started working on built-in schema support in REST framework 3.4.

Pull request: encode/django-rest-framework#4179
Upcoming new tutorial section: https://github.com/tomchristie/django-rest-framework/blob/schema-support/docs/tutorial/7-schemas-and-client-libraries.md

I think the client library support in particular is a big deal, and using Core API as the internal representation format is a necessary part of that.

This'll be relevant to django-rest-framework-docs because there will be built-in introspection, and this pacakge could then just rely on the coreapi.Document object that it returns and render that into the docs.

Raising this here and against the swagger package just to make you folks aware that this is in the works / open the conversation / invite feedback etc...

Cheers!

cannot load endpoints from different urls files

In case someone is using subdomains and his api endpoints are in a separate urls.py file (ex.: api_urls.py) its unable to find the routes.
IMHO it would be great to have a setting (variable) in settings.py where this file can be defined and not strictly use the base urls.py.

Need a version of DRF-docs that works with ProtectedResourceView

Currently DRF-docs (and other toolkits I could find) only work with APIView or subclasses. I have an application based on the Django REST Framework, but I am also using django-oauth-toolkit for authorization, which means all my views are based on ProtectedResourceView, which is not a subclass of APIView.

Are you aware of any self-documenting api tools that work with ProtectedResourceView, or do you have any plans to support this in the near future?

Unused dirs in global site-packages directory.

After installing drfdocs there are unused directories in site-packages, such as site and tests.
In setup.py file param packages should contain only "rest_framework_docs" entry, something like this:

    ...
    packages=['rest_framework_docs', ],
    ...

It is important also because unused directories have very common names (site and tests).

Exclude internal API

I don't see any possibility to exclude some views from docs. Is this feature implemented ?

Problem: I have internal API which is in 'internal' namespace and external one in 'api'. I would like to show only endpoints from external API.

Documentation does not say anything about it and I don't see place in code where I could filter or exclude endpoints by namespace or by app.

An idea to support per-method serializer in a Viewset

I've implemented something like this on my fork

from my_serializers import PasswordSerializer
from rest_framework_docs.utils import func_serializer

class UserViewSet(viewsets.ViewSet):

    @func_serializer(serializer_class=PasswordSerializer)
    @detail_route(methods=['post'])
    def set_password(self, request, pk=None):
        serializer = PasswordSerializer(data=request.data)

I wonder if you are keen on extending your library with something like this? I think it's a handy feature.

The downside of this is that we have to change application code to support documentation generation. Another approach is to use docstring, something like


class UserViewSet(viewsets.ViewSet):

    @detail_route(methods=['post'])
    def set_password(self, request, pk=None):
        """
        :func_serializer: my_serializers.PasswordSerializer
        """
        serializer = PasswordSerializer(data=request.data)

I think I like the first approach better.

__get_serializer_class__() method does not works

djangorestframework==3.4.0, GenericViewSet. Inherited ViewSet doesn't contents serializer_class property, but method gets serializer_class attribute from parent. I think, that get_serializer_class must have more priotity

API Category Title manually changed in the urls.py

Hi,

screen shot 2016-07-23 at 6 15 14 pm

As you can see the title of my API category is "None" and I understand it is because I have a blank regex. But there cases that it will be useful if we can change the category title manually rather than it is automatically added by the parent url

I was wondering if it is possible to change the title of my API category to the urls.py like this:

from django.conf.urls import url, include

urlpatterns = [
    url(r'^', include('api.v1.store.urls', namespace='artists', app_name='artists')),
    url(r'^docs/', include('rest_framework_docs.urls')),
]

wrong doc generated when using ModelViewSets

When using ModelViewSets, the apis shown in doc are wrong.

class UserInfoSerializer(ModelSerializer):
    class Meta:
        model = User

class UserInfo(ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserInfoSerializer

urlpatterns = [
    url(r'^docs/', include('rest_framework_docs.urls')),
]

urlpatterns += router.urls

The results in /docs/ are

/docs/users/      OPTIONS
/docs/users/<pk>/  OPTIONS

Is this a already known bug?

AttributeError - module 'urls' has no attribute 'urls'

My understanding is that there are two common settings of ROOT_URLCONF people use. One is the default ROOT_URLCONF = '' value, and the second is ROOT_URLCONF = 'urls'. This project seems to fail if you use the latter (or at least it did for me). Changing that line to self.get_all_view_names(root_urlconf.urlpatterns) worked but it would be best to fix in the project.

The root urlconf can also be overridden at runtime via middleware so I think this urls module loading should perhaps be moved into the get_endpoints method or the value of that setting should be passed into the ApiDocumentation object on init.

Nice project BTW. :-)

ERROR to Access

Exception Value: 'NoneType' object is not iterable
Exception Location: .../site-packages/rest_framework_docs/api_endpoint.py in get_permissions_class, line 35

pip install fails with missing `setuptools.command` error

I get the following stack trace trying to pip install or upgrate drfdocs, using Python 2.7, on both a mac running OS X 10.11.5 and a Ubuntu 14.04 machine.

[ubuntu@SEA] pip install --upgrade drfdocs
Downloading/unpacking drfdocs from https://pypi.python.org/packages/e5/9e/3a9aa6908ad7bd95b46f7fe05256681f4101de9a7769b6928159a986ef61/drfdocs-0.0.11.tar.gz#md5=ae42aba1e598ac110de74bdad0f3d3f4
  Downloading drfdocs-0.0.11.tar.gz (771kB): 771kB downloaded
  Running setup.py (path:<VIRTUAL_ENV_PATH>/build/drfdocs/setup.py) egg_info for package drfdocs
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
    ImportError: No module named setuptools.command
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 3, in <module>

ImportError: No module named setuptools.command

----------------------------------------
Cleaning up...

Both installs were done within virtualenvs with django1.9 installed. pip versions were 1.5.4 & 1.5.6

I didn't find this behavior with any other pip modules. Don't know if it's something DrfDocs is doing in its setup or some other setup-related issue.

Cheers!

generate wrong data-path (API urls)

I have made the rule in the url.py
url(r'^docs/', include('rest_framework_docs.urls', namespace='docs')),

and i can server the doc app but all links are wrong:

/docs/api/notes/uid/add
but it should be /api/notes/uid/add

the rest is working great. Thank you for your good work.

django 1.10.5
drf 3.5.3
drf docs 0.0.11

.format URLs listed in docs

With the current DRF tutorial, I found that drfdocs displays these URL endpoints:

/snippets.<format>/
/snippets/<pk>.<format>/
/snippets/<pk>/highlight.<format>/

And others.

This is likely because the urls.py in the snippets app includes this:

from rest_framework.urlpatterns import format_suffix_patterns
...
urlpatterns = format_suffix_patterns(urlpatterns)

IMHO, drfdocs needs to ignore the additional URL patterns generated by format_suffix_patterns.

DRF Docs LiveAPI doesn't pass Django CSRF token

In developing with DRF Docs, I gave a couple of internal business users the Live API links in order to do manual testing. In their testing POST, PUT, and PATCH methods, they were receiving an error message due to the missing CSRF token.

Is there a reason DRF Docs doesn't automatically pass this data if it exists?

ala a potential solution here:
https://github.com/jroblak/django-rest-framework-docs/blob/master/rest_framework_docs/static/rest_framework_docs/js/components/liveapi.js

[Live API] GET request successful but response is null

I am testing the Live API endpoints feature of drf-docs. The server is running on localhost.
Get request is sent successfully as I can verify it from the running server's terminal.

Here is a screenshot

screenshot from 2016-04-07 01 58 49

Is there some way I can help debug the issue .
Thanks

"urls doesn't look like a module path" for settings.ROOT_URLCONF

Heyoo, thanks so much for releasing this!

I seem to be having a problem based on this setting:
ROOT_URLCONF = 'urls'

  File "/Users/eric/.virtualenvs/image_first/lib/python3.5/site-packages/rest_framework_docs/views.py", line 17, in get_context_data
    docs = ApiDocumentation()
  File "/Users/eric/.virtualenvs/image_first/lib/python3.5/site-packages/rest_framework_docs/api_docs.py", line 12, in __init__
    root_urlconf = import_string(settings.ROOT_URLCONF)
  File "/Users/eric/.virtualenvs/image_first/lib/python3.5/site-packages/django/utils/module_loading.py", line 18, in import_string
    six.reraise(ImportError, ImportError(msg), sys.exc_info()[2])
  File "/Users/eric/.virtualenvs/image_first/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/Users/eric/.virtualenvs/image_first/lib/python3.5/site-packages/django/utils/module_loading.py", line 15, in import_string
    module_path, class_name = dotted_path.rsplit('.', 1)
ImportError: urls doesn't look like a module path

Changing to this works:
ROOT_URLCONF = 'src.urls'

Middle slash removed by "replace"

In an DRF router endpoint I'm seeing the following behavior:

url(r'^api/v1/', include(router.urls)), # becomes "apiv1" in DRF docs output

Not sure exactly sure why slashes are being replaced on this line, but perhaps a strip('/') than replace('/','')would be more appropriate, as that would preserve slashes in the middle, like I need.

https://github.com/ekonstantinidis/django-rest-framework-docs/blob/9a85323c4147ec4ebb754a8b0373c956ee89b821/rest_framework_docs/api_endpoint.py#L1

Happy to make a PR

setting the fields description if you are using function based views

How do I set the field descriptions in views.py on function based views?

This is my syntax:
@api_view(['GET', 'POST'])
def api_section(request):
"""
GET request gets the section and its details..... POST request, adds a new section
"""
if request.method == 'GET':
sections = Section.objects.all()
serializer = SectionSerializer(sections, many=True)
return Response(serializer.data)

elif request.method == 'POST':
    serializer = SectionSerializer(data=request.data)
    if serializer.is_valid():
        serializer.save()
        serializer_data = serializer.data
        del serializer_data['id']
        return Response(serializer_data, status=status.HTTP_201_CREATED)
    else:
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)

Field descriptions seems to work smoothly by declaring a serializer_class variable in class-based views that inherits APIView like this one:

class ObtainAuthToken(APIView):
throttle_classes = ()
permission_classes = ()
parser_classes = (parsers.FormParser, parsers.MultiPartParser, parsers.JSONParser,)
renderer_classes = (renderers.JSONRenderer,)
serializer_class = AuthTokenSerializer

def post(self, request, *args, **kwargs):
    serializer = self.serializer_class(data=request.data)
    serializer.is_valid(raise_exception=True)
    user = serializer.validated_data['user']
    token, created = Token.objects.get_or_create(user=user)
    return Response({'token': token.key})

API information empty

I am currently having this issue where some of the APIs have empty parameters and are classified in a group called None.

Here is a screenshot: http://i.imgur.com/2pXFhLj.png

Here are the APIs that seem to be incompatible:
url(r'^api-token-auth/', rest_views.obtain_auth_token),
url(r'^api/v1/auth/login/$', LoginView.as_view(), name='login'),
url(r'^api/v1/ios/auth/login/$', LoginView.as_view()),
url(r'^api/v1/auth/logout/$', LogoutView.as_view(), name='logout'),
url(r'^api/v1/ios/auth/logout/$', LogoutView.as_view()),

Also, is there a way to create "Groups" of APIs manually to organize the page more?

Many Thanks!

ModelViewSet doesn't show request methods, instead it only show option button

I am using model view set and register it with router. On /docs url, it shows only option button. It doesn't show request methods(eg. GET, POST etc). Similarly on clicking plugin button, it only shows option button, not request methods. I am not able to send get request. Since it shows field required error messages.

Enhancement

I found way to extend field information for at least: default, max length, min length with potential display it as table instead list - that could be configurable.
Could you allow me to create branch to present this enhancement ? Please

Support for dynamic fields?

Hey there, DRF docs looks really cool. But it looks like the project doesn't currently have support for viewsets that implement a get_serializer method. In my case, I use information from the request (specifically the token scopes) to determine the fields available to the client. This means that it's an error to instantiate a serializer without providing a request variable in a context kwarg. And DRF-docs does exactly this in api_endpoint.py:50

Is there any way I can override the methods that determine fields to show? Thanks!

Whether to support APIView ?

f I use APIView to design API, what should I do

eg :

url(r'^alipay.pay.unified.order/$', views.AlipayPayUnifiedOrderView.as_view(), name='alipay.pay.unified.order'),

class AlipayPayUnifiedOrderView(BaseOpenGateWayRequestView):
    request_params = ('merchant_code', 'total_amount', 'out_trade_no', 'subject', 'card_code')

    def get(self, request, format=None):
        """
        """
        return resp_data(pay_api.alipay_pay_unified_order(self.get_request_params(request, self.request_params)))

Help needed?

Does anybody still care about the management of pull requests? Do you guys need help?
Project is truly awesome, missing few features but still. It would shame to waste that potential.

Showing request body, just like response body

Hi guys, great work on the docs so far. I have try it on a toy project and is fantastic.

However one of the feature i am looking for is actually to show the request body just like a response body when the request is send. Do you think this is a reasonable feature ?

Support for nested serializers

Hi there,

Great tool! Are there any plans to support nested serializers? Like say:

class FooSerializer(serializers.Serializer):
    spam = serializers.CharField()    

class BarSerializer(serializers.Serializer):
    foo = FooSerializer()

The endpoint for BarSerializer would list all the fields inside FooSerializer.

If you point me in the right direction, I can also take a look myself. Thanks again for making this tool.

Best,

Silvio

Support for docs versioning

Going through the docs, I couldnt find any support for versioning of docs. May be we can arrive at an approach from where we can pick up the changes in API formats and highlight them. This feature is useful for developers to check the changes in the latest documentation compared with its predecessor.

Support For Image Field ?

I am writing a serializer that need image as multipart/form-data.If Drfdocs supports that ?

My serializer is like this :

email = serializers.CharField(required=True)
phone_number = serializers.CharField(required=True)
image = serializers.ImageField(allow_empty_file=True,required=False)

doesn't work with custom Django users

I regularly subclass Django's built in User class and remove the username field in favor of email (as many people do). drfdocs fails on this with (for custom user CustomUser):

ImproperlyConfigured: Field name `username` is not valid for model `CustomUser`.

Not sure if there's a supported way to handle this, but didn't see one in the documentation.

Django 1.10 support?

Looking for a documentation framework, does drf docs support Django 1.10? The readme only mentions 1.8 and 1.9.

Live API does not show alternative content type

When I use the Live API with my endpoints it always shows this:

screen shot 2016-09-07 at 11 43 35

I'm guessing that since I use content-type application/vnd.api+json in my response, that this is not picked up.

Is there any way to tell the Live API to accept a different content type?

Can not template overriding

This is my folder structure
image

docs.html and base.html is blank

urls.py
image

views.py
image

I think it have to render nothing.
But when i runserver, render this page
image

Thanks for read my write

Unclear error messages

I am getting Oops! There was something wrong with 'request'. Please check your code. when trying to view the parameters of any of my views. It took me awhile but I figured out that it was because I was accessing the request on the context of a serializer. I guess this is not good when trying to use this for documentation. Could we expand the error to maybe show some more information?

How to regroup endpoints by namespace?

by name_parent is not good.

I write this
url(r'^api/v1/', include('game.urls', namespace='game')),
url(r'^api/v1/', include('myuser.urls', namespace='account')),

and the group name is 'api/v1'

Add permissions

It would be great if we could hide the API behind a login that only allows superusers to login. I'm up for creating a PR. This functionality could be enabled via the settings:

REST_FRAMEWORK_DOCS = {
    'PERMISSIONS_REQUIRED': True  # Set the default to True perhaps?
}

What do you think?

Live API Endpoints Beta - Authorization: JWT 404 problem in DRFD

I know that Live API Endpoints is Beta, but I noticed some issue that GET/POST by send button giving "Status: not found" and "null" with JWT. My endpoints working corectly by curl, or without authorization in DRDF (then result is corect in Live API Endpoints Beta).
The request with JWT to the server is corect in JS debuger console and network communication around JWT data token.

Other - looks that Add Extra Fields not working.

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.