question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DRFDocs not showing delete, post, etc. options but regular docs do?

See original GitHub issue

Heyo! Thanks so much for releasing this, it is beautiful.

I am a little confused on why I’m not seeing POST/DELETE/etc. on the DRF docs version, but I can see it on the regular API docs:

image

image

Looks like I can only do GET/OPTIONS?

Here’s some code:

from rest_framework import viewsets, mixins

from api import serializers
from competitions.models import Competition


class CompetitionViewSet(mixins.ListModelMixin,
                         mixins.CreateModelMixin,
                         mixins.UpdateModelMixin,
                         mixins.DestroyModelMixin,
                         viewsets.GenericViewSet):
    """Tyler loves pizza!!!"""
    queryset = Competition.objects.all()
    serializer_class = serializers.CompetitionSerializer
from django.conf.urls import url, include
from rest_framework import routers

from . import views


router = routers.DefaultRouter()
router.register(r'competitions', views.CompetitionViewSet)

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

    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),

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

It’s probably something silly I’m overlooking, thanks!

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

4reactions
ckcollabcommented, Aug 30, 2017

Using this combination of classes seems to work:

from rest_framework.viewsets import GenericViewSet
from rest_framework.generics import ListAPIView, CreateAPIView, RetrieveAPIView, DestroyAPIView


class DataViewSet(ListAPIView, CreateAPIView, RetrieveAPIView, DestroyAPIView, GenericViewSet):
    pass

I think that this is about the same behavior, just different classes… that seem to work? This is for a simple dummy app that does nothing, so I’m not sure if this breaks other things.

0reactions
ckcollabcommented, Sep 28, 2017

No, no updates here. We need a way to help maintainers get updates through… some kind of reward system…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documenting your API - Django REST framework
REST framework provides built-in support for generating OpenAPI schemas, which can be used with tools that allow you to build API documentation.
Read more >
Delete Posts from General Channel - Microsoft Tech Community
Hi All, I know that I can not delete a general channel but I would like to delete ... can delete all messages"...
Read more >
How do I delete all posts from Google Classroom?
I've been sending feedback near weekly about how they need to add an option to delete multiple items at once, but I guess...
Read more >
How to show query parameter options in Django REST ...
@dnit13 There is markdown support in DRF docs, but not released yet, pepole can still use it with a custom templatetag and a...
Read more >
How to Bulk Delete WordPress Posts in 3 Simple Steps
But with the right steps, you can bulk delete WordPress posts in just a few minutes. In this article, we will show you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found