3

Following a deprecated post and this answer I have set up a separate file for storing SECRET_KEY and importing it into the main settings.py file. However, I am getting the following error:

ImportError: No module named 'settings_secret'

settings_secret.py

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '..key'

settings.py

from settings_secret import *

and .gitignore

# Secret Settings
settings_secret.py
Palinuro
  • 184
  • 1
  • 1
  • 15
Jebediah15
  • 754
  • 3
  • 18
  • 39

1 Answers1

1

Just try, from .settings_secret import * . [dot] ensures that you are importing from the current module.

Aswin Kumar K P
  • 1,023
  • 2
  • 12
  • 21