I have an app that was created in an "old" directory using "django-admin startproject businesscontacts"
old location: C:\Users..\backendworkproj\businesscontacts
moved to new location: C:\Users..\backendworkproj\appmasterdata\businesscontacts
Now, of course, the app that was working is now broken. My understanding is that "C:\Users..\backendworkproj\appmasterdata" needs to be put in the PYTHONPATH.
I know that there are other explanations out there - but - I am trying to follow one of the responses listed here: Permanently add a directory to PYTHONPATH
It says: Instead of manipulating PYTHONPATH you can also create a path configuration file. First find out in which directory Python searches for this information:
To me, it is not clear exactly what is to go into the .pth file. I did not see anything stating whether or not a full-path is needed or a realtive-path or ...
In my case,
1. run python -m site --user-site
output => C:\Users\...\AppData\Roaming\Python\Python36\site-packages
2. Made sure that the directory existed
3. echo "$HOME/foo/bar" > "$SITEDIR/somelib.pth"
Again, not sure what is supposed to be in the .pth file - or - what the name of the file should be (with Step #3)
TIA
Update
Never mind. I tried to delete this message but was unable to do so. This is what I did:
In the
C:\Users\...Roaming\Python\Python36\site-packages
directory, I created a file called appmaster.pth
The contents of the .pth file are:
C:\Users\...\backendworkproj\appmasterdata
(i.e. the full path to the project)
Things are working fine now.