Skip to content

Commit 3ff5d03

Browse files
authored
Merge branch 'main' into update/docs-pipenv-to-poetry
2 parents ad1a90b + 7d6de90 commit 3ff5d03

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pydis_site/apps/home/views/home.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from django.views import View
1010

1111
from pydis_site.apps.home.models import RepositoryMetadata
12+
from pydis_site.constants import GITHUB_TOKEN
1213

1314
log = logging.getLogger(__name__)
1415

@@ -18,6 +19,7 @@ class HomeView(View):
1819

1920
github_api = "https://api.github.com/users/python-discord/repos?per_page=100"
2021
repository_cache_ttl = 3600
22+
headers = {"Authorization": f"token {GITHUB_TOKEN}"}
2123

2224
# Which of our GitHub repos should be displayed on the front page, and in which order?
2325
repos = [
@@ -42,7 +44,7 @@ def _get_api_data(self) -> Dict[str, Dict[str, str]]:
4244
repo_dict = {}
4345

4446
# Fetch the data from the GitHub API
45-
api_data: List[dict] = requests.get(self.github_api).json()
47+
api_data: List[dict] = requests.get(self.github_api, headers=self.headers).json()
4648

4749
# Process the API data into our dict
4850
for repo in api_data:

pydis_site/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import os
22

33
GIT_SHA = os.environ.get("GIT_SHA", "development")
4+
GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN")

0 commit comments

Comments
 (0)