I have a variable like
k = os
If I have to import os I can write
import os
then I get no error
But how can I import k ( k is actually os
)
I tried
import k
then I got error there is no module.
I tried naming k = 'os'
instead of k = os
.Still I am getting the same error
Update :
Actually I have to import DATABASES
variable from settings file in the environmental variable DJANGO_SETTINGS_MODULE
How can I achieve this
from os.environ['DJANGO_SETTINGS_MODULE'] import DATABASES