title: Flask can only find file with relative path, not absolute path
body: <p>I have created a flask app that accesses images in a folder specified in a config file. For some reason, when I specify the full path to the folder (img_folder: '/user/userName/static/img/') I get a 404 error but when I specify the relative path (img_folder: './static/img/') it works. Looking at my terminal, the 404 error specifies the correct path and file, so the path is certainly correct.
  What is going on? How can I use the full path without receiving a 404.</p>
  
  <p>This is what it looks like when I specify the full path in the config folder:</p>
  
  <pre><code>img_folder : '/user/userName/static/img/'
  </code></pre>
  
  <p>This is the HTTP error when I specify the full path in the config:</p>
  
  <pre><code>127.0.0.1 - - [06/Jul/2018 11:26:25] "GET /user/userName/static/img/lion.jpg HTTP/1.1" 404
  </code></pre>
  
  <p>When I specify the relative path in the config folder like this:</p>
  
  <pre><code>img_folder : './static/img/'
  </code></pre>
  
  <p>I don't get the 404 error</p>
  
  <p>In my flask app file, I have a route that uses the files from the folder as such:</p>
  
  <pre><code>files = os.listdir(img_folder)
  @app.route('/', methods=['GET', 'POST'])
  def init():
    return render_template('display.html', file=files[0])
  </code></pre>
  
  <p>display.html</p>
  
  <pre><code>&lt;!doctype html&gt;
          &lt;div id='img_area'&gt;
              &lt;img src="{{file}}"&gt;&lt;/img&gt;
          &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>So the file is not being displayed when the full path is used, but is being displayed with the relative path.</p>