I am trying to set a python variable in vim using vimscript output. The following code is causing the issue:
python os.environ['DJANGO_SETTINGS_MODULE'] = split(expand("%:p:h"), "\/")[4].'.settings'
The issue is that i am running a line of python code, but want everything after the "=" sign to be evaluated by vim, as I want to assign the value of the :split(expand("%:p:h"), "\/")[4].'.settings' vim command to the python variable os.environ['DJANGO_SETTINGS_MODULE']
How can I do this?