Keywords: Django - AWS - Technical issue - Other
I am unable to set an environment variable for SECRET_KEY. The website loads fine when I leave the variable as plaintext in my settings.py file, but when I try to load the value of SECRET_KEY from my environment file, it is unable to be read, and my website loads this message.
"Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at firstname.lastname@example.org to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log."
I would like to fix this problem and i can also attach my settings.py as well as my directory.
from pathlib import Path import os #import environ #from configurations import Configuration from dotenv import load_dotenv load_dotenv() # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = os.getenv('SECRET_KEY')
SECRET_KEY = *