Here’s what I am trying to do - I have changed the config to point to TEST from PROD and my URLs are the same. I created a secret key as well.
PS C:\Users\tedbo\OneDrive\Documents\mflix-python> python run.py
Traceback (most recent call last):
File “run.py”, line 13, in
app.config[‘MFLIX_DB_URI’] = config[‘PROD’][‘MFLIX_DB_URI’]
File “C:\ProgramData\Anaconda3\lib\configparser.py”, line 958, in getitem
raise KeyError(key)
KeyError: ‘PROD’
PS C:\Users\tedbo\OneDrive\Documents\mflix-python> python run.py
Traceback (most recent call last):
File “run.py”, line 13, in
app.config[‘MFLIX_DB_URI’] = config[‘TEST’][‘MFLIX_DB_URI’]
File “C:\ProgramData\Anaconda3\lib\configparser.py”, line 958, in getitem
raise KeyError(key)
KeyError: ‘TEST’
Please help. What within the INI needs to exist - the instructions are kind of cloudy on that.
Here’s the INI file. I am running this from the location of the python file.
Ticket: Connection
Rename this file to .ini after filling in your MFLIX_DB_URI and your SECRET_KEY
Do not surround the URI with quotes
[PROD]
SECRET_KEY = WDdUO5iE2inmrJZ4QRRt+6EUEo2+cGBSKYmtNYOf5yAR
MFLIX_DB_URI = mongodb+srv://m220student:m220password@mflix-jwtvw.mongodb.net/test?retryWrites=true&w=majority
MFLIX_NS = sample_mflix
[TEST]
SECRET_KEY = WDdUO5iE2inmrJZ4QRRt+6EUEo2+cGBSKYmtNYOf5yAR
MFLIX_DB_URI = mongodb+srv://m220student:m220password@mflix-jwtvw.mongodb.net/test?retryWrites=true&w=majority
MFLIX_NS = sample_mflix