title: Image not showing with Flask HTML CSS background image
body: <p>I'm trying to set a background image using Python3 with Flask.</p>
  
  <p>My Python file looks like this:</p>
  
  <pre><code>app = Flask(__name__, static_url_path='/static/', static_folder='/static/')
  
  @app.route("/", methods=["GET"])
  def index():
    return render_template('index.html')
  </code></pre>
  
  <p>The HTML block includes:</p>
  
  <pre><code>&lt;head&gt;
    &lt;link rel="stylesheet" href="/static/main.css"&gt;
    &lt;!-- Bootstrap 4 beta --&gt;
       &lt;link rel="stylesheet"...
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="container"&gt;
  &lt;div class="row"&gt;
      &lt;div class="col-md-4 col-12 bg-logo"&gt;
          col 1
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>And my CSS file:</p>
  
  <pre><code>.bg-logo{
    background: url({{ url_for ('static', filename = '/static/img.png') }});
    background-size: 100% 100%;
    height: 300px;
    background-size: cover;
  }
  </code></pre>
  
  <p>For some reason, the browser can't get to the CSS file correctly. I need a way to serve the static files from the static folder without a @app.route</p>