aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/home/views/home.py
diff options
context:
space:
mode:
authorGravatar swfarnsworth <[email protected]>2021-07-04 21:35:32 -0400
committerGravatar swfarnsworth <[email protected]>2021-07-04 21:35:32 -0400
commitcb058d85af826077641f7a6b05c07a975122987d (patch)
tree030c02f91a3cffcc491b848eee25796e7ffb5b23 /pydis_site/apps/home/views/home.py
parentUpdate templates with new resource urls. (diff)
parentMerge pull request #547 from Numerlor/docker-override (diff)
Merge branch 'main' of https://github.com/python-discord/site into swfarnsworth/smarter-resources/new-resources
Diffstat (limited to 'pydis_site/apps/home/views/home.py')
-rw-r--r--pydis_site/apps/home/views/home.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pydis_site/apps/home/views/home.py b/pydis_site/apps/home/views/home.py
index e77772fb..b3767d37 100644
--- a/pydis_site/apps/home/views/home.py
+++ b/pydis_site/apps/home/views/home.py
@@ -9,6 +9,7 @@ from django.utils import timezone
from django.views import View
from pydis_site.apps.home.models import RepositoryMetadata
+from pydis_site.constants import GITHUB_TOKEN
log = logging.getLogger(__name__)
@@ -18,6 +19,7 @@ class HomeView(View):
github_api = "https://api.github.com/users/python-discord/repos?per_page=100"
repository_cache_ttl = 3600
+ headers = {"Authorization": f"token {GITHUB_TOKEN}"}
# Which of our GitHub repos should be displayed on the front page, and in which order?
repos = [
@@ -42,7 +44,7 @@ class HomeView(View):
repo_dict = {}
# Fetch the data from the GitHub API
- api_data: List[dict] = requests.get(self.github_api).json()
+ api_data: List[dict] = requests.get(self.github_api, headers=self.headers).json()
# Process the API data into our dict
for repo in api_data: