title: Flask unable to resolve static files after moving app.py and static folder
body: <p>I am packaging up my Flask app and I am unable to resolve static URLs after migrating the app.py into the module ship_comm even though it is picking up the new templates path when I change the root_folder. Here is my structure:</p>
  
  <pre><code>├── README.md 
  ├── requirements.txt 
  ├── setup.py 
  └── ship_comm
      ├── app.py
      ├── config.py
      ├── database.py
      ├── db_models.py
      ├── devices.py
      ├── replay.py
      ├── router.py
      ├── routing.db
      ├── static
      │   ├── css
      │   │   └── main.css
      │   └── img
      │       ├── captain-ai-logo-small.png
      │       ├── captain-ai-logo-square.png
      │       ├── favicon.ico
      │       └── screenshot.png
      └── templates
          ├── devices.html
          ├── home.html
          ├── layout.html
          ├── messages.html
          ├── new_route.html
          ├── new_serial.html
          ├── new_udp.html
          └── routes.html
  </code></pre>
  
  <p>And here is my initialization of the Flask app</p>
  
  <p><code>app = Flask(__name__, root_path='ship_comm')</code></p>
  
  <p>This fixed my issue with TemplateNotFound error, but still it's not able to find the static folder, even though it should be able to find it in the root_path right? I have tried explicitly stating <code>static_folder='ship_comm/static'</code> and <code>static_folder='static'</code> but that also didn't help.</p>
  
  <p>I call the app by using <code>python -m ship_comm.app</code></p>
  
  <p>Here is my layout.html that is now missing the logo:</p>
  
  <pre><code>&lt;!doctype html  lang="en"&gt;
  &lt;link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.ico') }}"&gt;
  &lt;title&gt;Ship Comm Router&lt;/title&gt;
  &lt;head&gt;
      &lt;!-- Latest compiled and minified CSS --&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
  
  &lt;!-- Optional theme --&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"&gt;
  
  &lt;!-- Latest compiled and minified JavaScript --&gt;
  &lt;!-- &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"&gt;&lt;/script&gt; --&gt;
  
  &lt;!--- mobile stuff ---&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;meta charset="utf-8"&gt; 
  &lt;/head&gt;
  &lt;link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}"&gt;
  &lt;div class="container-fluid"&gt;
  &lt;a href="/"&gt;&lt;h1&gt;Ship Comm Router&lt;/h1&gt;&lt;/a&gt;
  {%- for category, message in get_flashed_messages(with_categories=true) %}
    &lt;p class="flask {{ category }}-flash"&gt;{{
      "Error: " if category == 'error' }}{{ message }}&lt;/p&gt;
  {%- endfor %}
  &lt;hr&gt;
  {% block body %}{% endblock %}
  &lt;hr&gt;
  &lt;div id="footer"&gt;
      &lt;!--&lt;img width="50px" src="../static/img/captain-ai-logo-small.png"/&gt;--&gt;
      &lt;img width="50px" src="{{url_for('static', filename='img/captain-ai-logo-small.png')}}"/&gt;
      Developed by Captain AI - 2018
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- &lt;address&gt;Flask and SQLAlchemy powered Serial and UDP Router&lt;/address&gt; --&gt;
  </code></pre>
  
  <p>I am using Python 3.6.7 and Flask==1.0.2</p>