I keep getting an import error on environ in my settings.py file, I have it installed via poetry in my .venv file as well. Could this be an error outside the settings file possibly?
`
import environ
env = environ.Env(
DEBUG=(bool, False),
ENVIORNMENT=(str, 'PRODUCTION'),
)
environ.Env.read_env()
ENVIRONMENT= env.str('ENVIRONMENT')
SECRET_KEY = env.str('SECRET_KEY')
DEBUG = env.bool('DEBUG')
ALLOWED_HOSTS = tuple(env.list('ALLOWED_HOSTS'))
`
The problem could occur due to the following reasons:
Make sure that you are using the desired python interpreter, that your virtualenv is setup correctly, and that the desired django-environ is installed within that virtualenv via
(inside venv) pip install django-environ
Make sure you have done the following three actions:
Install the package through this command:
(inside venv) pip install django-environ
Select the right python interpreter(the environment in which you have installed the package)
Create an ".env" file in project root directory. And based on its reference doc here, it should be consisting of something like below:
DEBUG=on
SECRET_KEY=your-secret-key
DATABASE_URL=psql://user:un-githubbedpassword@127.0.0.1:8458/database
SQLITE_URL=sqlite:///my-local-sqlite.db
CACHE_URL=memcache://127.0.0.1:11211,127.0.0.1:11212,127.0.0.1:11213
REDIS_URL=rediscache://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient&password=ungithubbed-secret