Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

All endpoints in automatic API documentation disappear whenapi-token-auth endpoint added #5112

Closed
Milestone
@elmehalawi

Description

@elmehalawi

Steps to reproduce

CreateModelViewSets andSerializers. Register theViewSets in a router:

class ResultSerializer(serializers.ModelSerializer):    test = serializers.PrimaryKeyRelatedField(queryset=Test.objects.all())    certification = serializers.PrimaryKeyRelatedField(queryset=Certification.objects.all())    value = serializers.CharField()    class Meta:        model = Result        fields = '__all__'class ResultViewSet(ModelViewSet):    queryset = Result.objects.all()    serializer_class = ResultSerializerrouter = DefaultRouter()router.register(r'results', ResultViewSet)urls = router.urls

Add router URLs and documentation URLs to URLconf:

urlpatterns = [    url(r'^admin/', admin.site.urls),    url(r'^certifications/', include('certifications.urls')),    url(r'^docs/', include_docs_urls(title='API Documentation')),]

Everything working as expected. Now add a token-based login endpoint URL as describedhere:

urlpatterns = [    url(r'^admin/', admin.site.urls),    url(r'^certifications/', include('certifications.urls')),    url(r'^docs/', include_docs_urls(title='API Documentation')),    url(r'^api-token-auth/', views.obtain_auth_token),]

Expected behavior

The documentation forapi-token-auth should appear alongside the rest of the API documentation.

Actual behavior

All documentation disappears, and is replaced with an entry forapi-token-auth. There is also a header by the name of one of my applications, but nothing is under this header.

screen shot 2017-05-02 at 3 06 33 pm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp