Add API: URLs, token auth, what-can-i-cook endpoint, log-cook with pantry deduction, browsable API

This commit is contained in:
Caine
2026-04-02 16:33:31 +01:00
parent 487bf46979
commit fe00286f75
4 changed files with 43 additions and 3 deletions
+12
View File
@@ -38,9 +38,21 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'kitchen',
]
# Django REST Framework
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
'rest_framework.authentication.SessionAuthentication', # for admin/browsable API
],
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
],
}
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',