Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

When I edit a .env file, and try to use the new variable the old one gets loaded

$
0
0

This is the content of .env file

YOUTUBE_API_KEY=SyCnieNj# old-api-key# YOUTUBE_API_KEY=AIzayCno

When i try to use YOUTUBE_API_KEY the old api is loadedThis is the part of the python code:

import osimport jsonimport timeimport googleapiclient.discoveryimport googleapiclient.errorsfrom dotenv import load_dotenv# Load API keysload_dotenv()# YouTube API setupYOUTUBE_API_KEY = os.getenv("YOUTUBE_API_KEY")

Even after removing all the comment line from .env file os.getenv("YOUTUBE_API_KEY") is still loading old api key

Can anyone explain the issue here?

When I changed the api key in .env and reloaded the script the script is still using the old api key


Viewing all articles
Browse latest Browse all 3831

Trending Articles