16
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
2
The problem could occur due to the following reasons:
- You are using. Virtual environment, but you installed module outside the virtual environment.
- You haven’t added ‘environ’, in your your settings.py file in INSTALLED_APPS.(based on its reference exceptionally not required for this package!)
- Yuglify compressor can't find binary from package installed through npm
- Django's {{ csrf_token }} is outputting the token value only, without the hidden input markup
- Use imaplib and oauth for connection with Gmail
0
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
- Uploading images using Django Admin?
- Return list of objects as dictionary with keys as the objects id with django rest framerwork
- What is the right way to use angular2 http requests with Django CSRF protection?
- Django- getting a list of foreign key objects
- How can I escape LaTeX special characters inside django templates?
0
In my case, I had one environ.py file that was clashing with the library import, changing the file name fixed the issue.
For Django there is another option that I use,
from os import getenv
from dotenv import load_dotenv
load_dotenv()
create a .env
file along with settings.py
then you have to load those variables. For example :
CONFIGURATION = getenv("CONFIGURATION")
Install the module using
pip install python-dotenv
- Django : ProgrammingError: column "id" does not exist
- Django – Supervisor : exited too quickly
- Is there a way to set the id value of new Django objects to start at a certain value?