aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/home/views/home.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-07-12 07:50:51 +0400
committerGravatar GitHub <[email protected]>2022-07-12 07:50:51 +0400
commit7511c6d4aff6f3ad31ccb43c00226a9187d7ece1 (patch)
tree0c26ec6aa690ce4c62c5cf9b56f4944066cc319e /pydis_site/apps/home/views/home.py
parentMerge #722 - resources: add The Algorithms and remove Atom (diff)
parentBump Django To 4.0 (diff)
Merge pull request #740 from python-discord/update-django
Update Django Version To 4.0
Diffstat (limited to 'pydis_site/apps/home/views/home.py')
-rw-r--r--pydis_site/apps/home/views/home.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/apps/home/views/home.py b/pydis_site/apps/home/views/home.py
index 69e706c5..9bb1f8fd 100644
--- a/pydis_site/apps/home/views/home.py
+++ b/pydis_site/apps/home/views/home.py
@@ -1,7 +1,7 @@
import logging
from typing import Dict, List
-import requests
+import httpx
from django.core.handlers.wsgi import WSGIRequest
from django.http import HttpResponse
from django.shortcuts import render
@@ -56,12 +56,12 @@ class HomeView(View):
repo_dict = {}
try:
# Fetch the data from the GitHub API
- api_data: List[dict] = requests.get(
+ api_data: List[dict] = httpx.get(
self.github_api,
headers=self.headers,
timeout=settings.TIMEOUT_PERIOD
).json()
- except requests.exceptions.Timeout:
+ except httpx.TimeoutException:
log.error("Request to fetch GitHub repository metadata for timed out!")
return repo_dict