diff --git a/backend/nba_app/urls.py b/backend/nba_app/urls.py index 15575f14..f9607822 100644 --- a/backend/nba_app/urls.py +++ b/backend/nba_app/urls.py @@ -7,8 +7,8 @@ path('login/', views.log_in, name='login'), path('feed/', views.feed, name='feed'), path('profile_view_edit/', views.profile_view_edit, name='profile_view_edit'), - path('follow_user/', views.follow_user, name='follow_user'), - path('unfollow_user/', views.unfollow_user, name='unfollow_user'), + path('follow_user/', views.follow_user, name='follow_user'), + path('unfollow_user/', views.unfollow_user, name='unfollow_user'), path('reset_password/', views.reset_password, name='reset_password'), path('post/', views.post, name='post'), path('search/', views.search, name='search'), diff --git a/backend/nba_app/views.py b/backend/nba_app/views.py index ffb0e2d9..688d2dd1 100644 --- a/backend/nba_app/views.py +++ b/backend/nba_app/views.py @@ -209,11 +209,11 @@ def reset_password(request): -def follow_user(request): +def follow_user(request, user_id): if request.method != 'POST': return JsonResponse({'error': 'Only POST requests are allowed.'}, status=405) - user_id = request.POST.get('user_id') + # user_id = request.POST.get('user_id') if request.user.user_id == user_id: return JsonResponse({'error': 'You cannot follow yourself.'}, status=400) @@ -236,11 +236,11 @@ def follow_user(request): -def unfollow_user(request): +def unfollow_user(request, user_id): if request.method != 'POST': return JsonResponse({'error': 'Only POST requests are allowed.'}, status=405) - user_id = request.POST.get('user_id') + # user_id = request.POST.get('user_id') # Retrieve the user to unfollow try: diff --git a/backend/nba_project/settings.py b/backend/nba_project/settings.py index 2ec4b9e2..0438d44a 100644 --- a/backend/nba_project/settings.py +++ b/backend/nba_project/settings.py @@ -96,12 +96,13 @@ # https://docs.djangoproject.com/en/5.0/ref/settings/#databases + DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': os.getenv('DB_NAME'), - 'HOST': '64.226.89.39',#os.getenv('DB_HOST'), - 'PORT': '3307',#os.getenv('DB_PORT'), + 'HOST': os.getenv('DB_HOST'), + 'PORT': os.getenv('DB_PORT'), 'USER': os.getenv('DB_USER'), 'PASSWORD': os.getenv('DB_PASSWORD'), }