2

Following this post and this answer I have set up a separate file for storing SECRETY_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
Community
  • 1
  • 1
Jebediah15
  • 692
  • 1
  • 18
  • 38

1 Answers1

1

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

Aswin Kumar K P
  • 993
  • 2
  • 10
  • 21