title: how to point correctly to static image in django
body: <p>I have a template that renders an image:</p>
  
  <pre><code>{% load staticfiles %}
  
  &lt;img src="{% static "img/logo.png" %}" alt="My image"/&gt;
  </code></pre>
  
  <p>The image link is broken, but it points to:</p>
  
  <pre><code>localhost/static/img/logo.png
  </code></pre>
  
  <p>What are values I need to set for static_root, static_url, and STATICFILES_DIRS to get this image to show up correctly?</p>
  
  <p>This is my directory structure:</p>
  
  <p>myprojectname (top level)</p>
  
  <p>--- myprojectname</p>
  
  <p>--- --- myproectname</p>
  
  <p>--- --- --- settings</p>
  
  <p>--- --- --- --- base.py (setting.py)</p>
  
  <p>--- --- static</p>
  
  <p>--- --- --- img</p>
  
  <p>This is my static configuration in settings:</p>
  
  <pre><code>STATIC_ROOT = '/Users/myuser/myprojectname/myprojectname'
  STATIC_URL = '/static/'
  
  STATICFILES_DIRS = (
      #normpath(join(SITE_ROOT, 'static')),
      os.path.join(BASE_DIR, "static"),
      '/Users/myuser/myprojectname/myprojectname/static',
  )
  </code></pre>
  
  <p>This is what it shows:
  <img src="https://i.stack.imgur.com/SUmw4.png" alt="enter image description here"></p>
  
  <p>I have already done a collectstatic and this doesn't work.</p>