Przeglądaj źródła

Upgrade Django and dependencies for compatibility with Python 3.10+

Ben Wilber 5 miesięcy temu
rodzic
commit
39dea6c97b
3 zmienionych plików z 27 dodań i 23 usunięć
  1. 1 0
      grunge/settings.py
  2. 3 3
      grunge/viewsets.py
  3. 23 20
      requirements.txt

+ 1 - 0
grunge/settings.py

@@ -107,6 +107,7 @@ CSRF_TRUSTED_ORIGINS = ENV.list("CSRF_TRUSTED_ORIGINS", default=[])
 if SESSION_COOKIE_DOMAIN:
     CSRF_TRUSTED_ORIGINS.append(SESSION_COOKIE_DOMAIN)
 
+DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
 
 # Database
 # https://docs.djangoproject.com/en/3.1/ref/settings/#databases

+ 3 - 3
grunge/viewsets.py

@@ -13,13 +13,13 @@ class BaseAPIViewSet(viewsets.ReadOnlyModelViewSet):
 class ArtistViewSet(BaseAPIViewSet):
     queryset = Artist.objects.all()
     serializer_class = ArtistSerializer
-    filter_class = ArtistFilter
+    filterset_class = ArtistFilter
 
 
 class AlbumViewSet(BaseAPIViewSet):
     queryset = Album.objects.all()
     serializer_class = AlbumSerializer
-    filter_class = AlbumFilter
+    filterset_class = AlbumFilter
 
     def get_queryset(self):
         queryset = super().get_queryset()
@@ -29,7 +29,7 @@ class AlbumViewSet(BaseAPIViewSet):
 class TrackViewSet(BaseAPIViewSet):
     queryset = Track.objects.all()
     serializer_class = TrackSerializer
-    filter_class = TrackFilter
+    filterset_class = TrackFilter
 
     def get_queryset(self):
         queryset = super().get_queryset()

+ 23 - 20
requirements.txt

@@ -1,23 +1,26 @@
 appdirs==1.4.4
-asgiref==3.3.1
-black==20.8b1
-click==7.1.2
-Django==3.1.5
-django-environ==0.4.5
-django-filter==2.4.0
-djangorestframework==3.12.2
-flake8==3.8.4
-furl==2.1.0
-isort==5.7.0
-mccabe==0.6.1
-mypy-extensions==0.4.3
+asgiref==3.8.1
+black==24.10.0
+click==8.1.7
+Django==5.1.2
+django-environ==0.11.2
+django-filter==24.3
+djangorestframework==3.15.2
+flake8==7.1.1
+furl==2.1.3
+isort==5.13.2
+mccabe==0.7.0
+mypy-extensions==1.0.0
 orderedmultidict==1.0.1
-pathspec==0.8.1
-pycodestyle==2.6.0
-pyflakes==2.2.0
-pytz==2020.5
-regex==2020.11.13
-six==1.15.0
-sqlparse==0.4.1
+packaging==24.1
+pathspec==0.12.1
+platformdirs==4.3.6
+pycodestyle==2.12.1
+pyflakes==3.2.0
+pytz==2024.2
+regex==2024.9.11
+six==1.16.0
+sqlparse==0.5.1
 toml==0.10.2
-typing-extensions==3.7.4.3
+tomli==2.0.2
+typing_extensions==4.12.2