Adding a path to the system using environ module
<p>In a setting file I append a path to the system hardcoding the url like this:</p>

<pre><code>sys.path.append('/home/user/path/to/projectdir')
</code></pre>

<p>It works.</p>

<p>As soon as I want to make it relative, it fails even if I retrieve the exact path with environ module.</p>

<pre><code>import environ

ROOT_DIR = environ.Path(__file__) - 3
sys.path.append(ROOT_DIR.path())
</code></pre>

<p>To me the incredible thing is that <code>print(ROOT_DIR.path())</code> outputs the exact url of project_dir.</p>

<pre><code>print(ROOT_DIR.path())
&gt; '/home/user/path/to/projectdir'
</code></pre>

<p>Here is the tree of my project. </p>

<pre><code>project_dir
└── soloscrap
    └── soloscrap
        ├── settings.py
</code></pre>

<p>How could I add this path then? Isn't it weird? </p>