api documentation basics

This commit is contained in:
vabene1111
2020-06-16 17:21:50 +02:00
parent aad8b220d1
commit 0a8270e7cf
7 changed files with 197 additions and 2 deletions

View File

@ -2,6 +2,7 @@ from pydoc import locate
from django.urls import path, include
from rest_framework import routers
from rest_framework.schemas import get_schema_view
from .views import *
from cookbook.views import api, import_export
@ -62,9 +63,16 @@ urlpatterns = [
path('dal/unit/', dal.UnitAutocomplete.as_view(), name='dal_unit'),
path('docs/markdown/', views.markdown_info, name='docs_markdown'),
path('docs/api/', views.api_info, name='docs_api'),
path('openapi', get_schema_view(
title="Django Recipes",
version=VERSION_NUMBER
), name='openapi-schema'),
path('api/', include((router.urls, 'api'))),
path('api-auth/', include('rest_framework.urls', namespace='rest_framework'))
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
]
generic_models = (Recipe, RecipeImport, Storage, RecipeBook, MealPlan, SyncLog, Sync, Comment, RecipeBookEntry, Keyword, Ingredient)