feat [both]: authentication

This commit is contained in:
Alice 2022-12-25 23:52:43 +01:00
parent 42fd29ce95
commit 04fedf7985
10 changed files with 178 additions and 4 deletions

View file

@ -12,5 +12,5 @@ router.register(r"tmdb", TmdbViewSet, "tmdb")
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
path("", include(router.urls)),
path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
path('auth/', include('dj_rest_auth.urls')),
]

View file

@ -5,3 +5,4 @@ djangorestframework-camel-case==1.3.0
getconf~=1.11.1
tmdbv3api~=1.7.6
factory-boy==3.2.1
dj-rest-auth==2.2.5

View file

@ -39,13 +39,14 @@ INSTALLED_APPS = [
"myapi.apps.MyapiConfig",
"rest_framework",
"corsheaders",
"dj_rest_auth",
]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"corsheaders.middleware.CorsMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
@ -128,3 +129,4 @@ REST_FRAMEWORK = {
}
TMDB_API_KEY = config.getstr("tmdb.api_key")
REST_AUTH_TOKEN_MODEL = None