Trouble running run.py

I have installed everything as per requirements in requirements.txt, but when i try to run run.py, I get a DNS timeout error:

please help, thanks!

Hi @Raghuram_Vadali_03611,

Please cross-check your configuration parameters in .ini file. If you are unable to resolve, please share the contents of .ini file.

Kanika

My .ini file is named “dotini_win.ini” and its contents are

[PROD]
SECRET_KEY = XXXXXXXX
MFLIX_DB_URI = mongodb+srv://mflix-XXXXX.mongodb.net/test --username m220student
MFLIX_NS = sample_mflix

[TEST]
SECRET_KEY = XXXXXXXX
MFLIX_DB_URI = mongodb+srv://mflix-XXXXX.mongodb.net/test --username m220student
MFLIX_NS = sample_mflix

Also, when I try to run: python requirements.txt install, I get the following error message:

File “requirements.txt”, line 1
Flask==0.12.4
^
SyntaxError: invalid syntax

Are there any changes I should be making to the requirements.txt file as well?

Thank you for your help! - R

You need to run pip install -r requirements.txt.

Kanika

Thank you for your help!

That worked out fine, but running python run.py still gives me the connection timed out problem. Could you take a look at the contents of my .ini file I pasted above? Thanks!

This needs to be updated. From cloud.mongodb.com, (your atlas account):

  1. Click on Connect
  2. Connect through Application
  3. Choose Python from dropdown and then Version.
  4. Click on Copy, ofcourse change username/password.

Kanika

Hello Kanika, thanks for that. Sorry to be badgering you, however I still seem to be having the same issue of DNS timeout. I changed the connection string so that my ini file now looks like this.

[PROD]
SECRET_KEY = XXXXX
MFLIX_DB_URI = mongodb+srv://m220student:m220password@mflix-XXXXX.mongodb.net/test?retryWrites=true&w=majority
MFLIX_NS = sample_mflix

[TEST]
SECRET_KEY = XXXXX
MFLIX_DB_URI = mongodb+srv://m220student:m220password@mflix-XXXXX.mongodb.net/test?retryWrites=true&w=majority
MFLIX_NS = sample_mflix

Any thoughts?

Please check your messages. Lets debug it :slight_smile:

Kanika

@Raghuram_Vadali_03611 , If you .ini contains XXXXX like you shared that is definitively wrong.You must put the host name of your cluster.