basic api

This commit is contained in:
vabene1111
2020-06-02 12:04:14 +02:00
parent a3dc5f283a
commit 2fcd207dc7
5 changed files with 33 additions and 2 deletions

View File

@ -1,11 +1,15 @@
from pydoc import locate
from django.urls import path
from django.urls import path, include
from rest_framework import routers
from .views import *
from cookbook.views import api, import_export
from cookbook.helper import dal
router = routers.DefaultRouter()
router.register(r'meal-plan', api.MealPlanViewSet)
urlpatterns = [
path('', views.index, name='index'),
path('setup/', views.setup, name='view_setup'),
@ -50,6 +54,9 @@ urlpatterns = [
path('dal/unit/', dal.UnitAutocomplete.as_view(), name='dal_unit'),
path('docs/markdown/', views.markdown_info, name='docs_markdown'),
path('api/', include((router.urls, 'api'))),
path('api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
generic_models = (Recipe, RecipeImport, Storage, RecipeBook, MealPlan, SyncLog, Sync, Comment, RecipeBookEntry, Keyword, Ingredient)