Django 2.3: I committed my secret key to a private repository. Can I just edit the secret key myself and then add .env file to .gitignore?
I have tried the same thing but unfortunately it doesn't work for me.

Install dotenv package: pip install -U python-dotenv
Import this package and call your .env variable: from dotenv import load_dotenv

Example is below
from dotenv import load_dotenv   #for python-dotenv method

load_dotenv()                    #for python-dotenv method

import os 

user_name = os.environ.get('USER')
password = os.environ.get('password')

print(user_name, password)
Output
username password
So in being a newb to Django I accidentally committed my secret key to a private repository that I have for my website. Considering that I intend to use this site for business purposes, I want to make sure that it is secure as possible. Do I need to generate a whole new Django Key? Or could I possibly just edit lets say, 10 characters of the secret key, add the edited secret key to my .env file, add the .env to my .gitignore file and call it a day? 
I recognize this is not the best approach. I will most likely completely generate a new secret key but I thought this might be an effective quick fix. 
I figure that by doing it this way the new secret key is still randomly generated and the old one is still available on github but useless to anyone who happens to scrape it. 
FYI I am using python-decouple with a .env file which is where I save all my secret variables (aws info, secret key, db info, etc.). I have separate settings files (production.py, development.py, common_settings.py) where both production.py and development.py import all of the data from common_settings.py. I just happened to forget to delete the original settings.py file before I made my first commit.