Skip to content

Commit

Permalink
Ensured API key is not viewable by third parties
Browse files Browse the repository at this point in the history
  • Loading branch information
tkpp26 committed Sep 5, 2024
1 parent 811b654 commit 9b203b7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions clothingRecommendationv2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,19 @@
"outputs": [],
"source": [
"from google.colab import files\n",
"# Upload kaggle.json\n",
"files.upload()"
"import json\n",
"import os\n",
"\n",
"# Upload kaggle.json file\n",
"uploaded = files.upload()\n",
"\n",
"# Load kaggle.json file\n",
"with open('kaggle.json') as f:\n",
" kaggle_config = json.load(f)\n",
"\n",
"# Set environment variables\n",
"os.environ['KAGGLE_USERNAME'] = kaggle_config['username']\n",
"os.environ['KAGGLE_KEY'] = kaggle_config['key']"
]
},
{
Expand Down

0 comments on commit 9b203b7

Please sign in to comment.