REST-API mit djangorestframework (init)

This commit is contained in:
2026-06-06 13:12:25 +02:00
committed by Hraban
parent af8d1e3d2c
commit 1264731de3
4 changed files with 15 additions and 1 deletions
+5 -1
View File
@@ -12,6 +12,7 @@ und für die öffentliche Rechercheplattform.
- Verlage - Verlage
- Nutzungsrechte und ihre Inhaber*innen - Nutzungsrechte und ihre Inhaber*innen
- Versionierung - Versionierung
- REST-API
## Abhängigkeiten ## Abhängigkeiten
@@ -20,6 +21,7 @@ und für die öffentliche Rechercheplattform.
- django-taggit - django-taggit
- django-taggit-helpers (uralt, funktioniert aber) - django-taggit-helpers (uralt, funktioniert aber)
- django-simple-history - django-simple-history
- djangorestframework
- PyYAML - PyYAML
## Installation ## Installation
@@ -28,6 +30,8 @@ Siehe [docs/README.md](docs/README.md)
## TODO ## TODO
- Modelle für Lieder
- Modelle für Liederbücher (nach `sources.yaml`, BibTeX-kompatibel) und Sammlungen
- Modelle für Verlage/Veröffentlicher und Nutzungsrechte - Modelle für Verlage/Veröffentlicher und Nutzungsrechte
- REST-API - andere Medien als Quellen (URLs, Tonträger)
- öffentliche Schnittstelle (Website; bisher nur Backend = Django-Admin) - öffentliche Schnittstelle (Website; bisher nur Backend = Django-Admin)
@@ -45,6 +45,7 @@ INSTALLED_APPS = [
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'simple-history', 'simple-history',
'rest_framework',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@@ -77,6 +78,13 @@ TEMPLATES = [
WSGI_APPLICATION = 'liederquelle.wsgi.application' WSGI_APPLICATION = 'liederquelle.wsgi.application'
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
"DEFAULT_PERMISSION_CLASSES": [
"rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly"
]
}
# Database # Database
# https://docs.djangoproject.com/en/6.0/ref/settings/#databases # https://docs.djangoproject.com/en/6.0/ref/settings/#databases
+1
View File
@@ -20,4 +20,5 @@ from django.urls import path
urlpatterns = [ urlpatterns = [
#path("quellen/", include("quellen.urls")), #path("quellen/", include("quellen.urls")),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('api-auth/', include('rest_framework.urls')),
] ]
+1
View File
@@ -6,3 +6,4 @@ django-dotenv
django-taggit django-taggit
django-taggit-helpers django-taggit-helpers
django-simple-history django-simple-history
djangorestframework