phase7: add minimal read-only drf api with player search endpoints

This commit is contained in:
Alfredo Di Stasio
2026-03-10 11:13:30 +01:00
parent ecd665e872
commit fa4c901bc1
12 changed files with 376 additions and 8 deletions

View File

@ -30,6 +30,8 @@ INSTALLED_APPS = [
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
"apps.api",
"apps.core",
"apps.users",
"apps.players",
@ -123,3 +125,17 @@ PROVIDER_MVP_DATA_FILE = os.getenv(
)
PROVIDER_REQUEST_RETRIES = int(os.getenv("PROVIDER_REQUEST_RETRIES", "3"))
PROVIDER_REQUEST_RETRY_SLEEP = float(os.getenv("PROVIDER_REQUEST_RETRY_SLEEP", "1"))
REST_FRAMEWORK = {
"DEFAULT_PERMISSION_CLASSES": [
"apps.api.permissions.ReadOnlyOrDeny",
],
"DEFAULT_THROTTLE_CLASSES": [
"rest_framework.throttling.AnonRateThrottle",
"rest_framework.throttling.UserRateThrottle",
],
"DEFAULT_THROTTLE_RATES": {
"anon": os.getenv("API_THROTTLE_ANON", "100/hour"),
"user": os.getenv("API_THROTTLE_USER", "1000/hour"),
},
}

View File

@ -3,6 +3,7 @@ from django.urls import include, path
urlpatterns = [
path("admin/", admin.site.urls),
path("api/", include("apps.api.urls")),
path("", include("apps.core.urls")),
path("users/", include("apps.users.urls")),
path("players/", include("apps.players.urls")),