I'm trying to add a directory to PATH with code like this:
PROJECT_DIR = Path(__file__).parents[2]
sys.path.append(
PROJECT_DIR / 'apps'
)
It doesn't work. If I do print sys.path
I see something like this:
[..., PosixPath('/opt/project/apps')]
How should I fix this code? Is it normal to write str(PROJECT_DIR / 'apps')
?