title: Flask app import not working while routing second time
body: <p>When i am importing a file in a flask route first time when i hit the route the import works but second time and so on it doesn't work. My both files are in same directory main.</p>
  
  <pre><code>├── main
  │   ├── main1.py
  │   └── main2.py
  </code></pre>
  
  <p>main1.py</p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__)
  
  @app.route('/')
  def hello_world():
      return "hello"
  
  @app.route('/call')
  def call():
      #This is the import i am talking about
      import main2
      print("main1")
      return "call"
  
  if __name__ == "__main__":
      app.run(debug =True, host='0.0.0.0',port = '5005')
  </code></pre>
  
  <p>main2.py</p>
  
  <pre><code>print("main2")
  </code></pre>
  
  <p>terminal output at <a href="http://0.0.0.0:5005/call" rel="nofollow noreferrer">http://0.0.0.0:5005/call</a> (Hit the url 3 times we can see 3 outputs)</p>
  
  <pre><code>* Serving Flask app "main1" (lazy loading)
   * Environment: production
     WARNING: Do not use the development server in a production environment.
     Use a production WSGI server instead.
   * Debug mode: on
   * Running on http://0.0.0.0:5005/ (Press CTRL+C to quit)
   * Restarting with inotify reloader
   * Debugger is active!
   * Debugger PIN: 226-069-185
  127.0.0.1 - - [30/Apr/2020 10:48:42] "GET / HTTP/1.1" 200 -
  main2
  main1
  127.0.0.1 - - [30/Apr/2020 10:48:46] "GET /call HTTP/1.1" 200 -
  main1
  127.0.0.1 - - [30/Apr/2020 10:48:49] "GET /call HTTP/1.1" 200 -
  main1
  127.0.0.1 - - [30/Apr/2020 10:48:50] "GET /call HTTP/1.1" 200 -
  </code></pre>
  
  <p>First time output is as accepted where import is working we can see 'main2' printed but while hitting again and again import doesn't work i don't see 'main2' printed.</p>