diff options
author | 2021-05-27 20:10:56 +0200 | |
---|---|---|
committer | 2021-05-27 20:10:56 +0200 | |
commit | 3ff5d03ee70ebc87f90c0dbf1c21606f9c719c51 (patch) | |
tree | 9b63e831d9110821e11b443c64221a7c67cee502 /pydis_site/apps | |
parent | chore: Update guides to use poetry instead of pipenv (diff) | |
parent | Merge pull request #513 from python-discord/auth-with-github-api (diff) |
Merge branch 'main' into update/docs-pipenv-to-poetry
Diffstat (limited to 'pydis_site/apps')
-rw-r--r-- | pydis_site/apps/home/views/home.py | 4 |
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: |