title: Error: While importing 'new_app', an ImportError was raised
body: <p>I am making flask app, the steps which i followed are</p>
  <ol>
  <li>made a directory and opened it</li>
  <li>made a virtual env using the command <code>python -m venv env</code></li>
  <li>activated the virtual environment using <code>env\Scripts\Activate</code>.</li>
  <li>used command <code>set FLASK_APP-new_app.py</code></li>
  <li>tried running using command <code>flask run</code></li>
  </ol>
  <p>the app is running well when i tried the demo helloworld, but made some changes in it which goes like this</p>
  <p>new_app.py</p>
  <pre><code>from flask import *
  from flask_sqlalchemy import SQLAlchemy
  import datetime
  from datetime import datetime
  import re
  from sqlalchemy import create_engine, Column, Integer, String, Sequence
  from sqlalchemy.ext.declarative import declarative_base
  app = Flask(__name__)
  
  app.config[&quot;SQLAlCHEMY_TRACK_NOTIFICATION&quot;]=True
  app.config[&quot;SQLAlCHEMY_TRACK_MODIFICATIONS&quot;]=True
  
  POSTGRES = {
       'user': 'postgres',
       'pw': '123',
       'db': 'ffs',
       'host': 'localhost',
       'port': '5431',
  }
  app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://%(user)s:\
  %(pw)s@%(host)s:%(port)s/%(db)s' % POSTGRES
  app.debug=True
  db= SQLAlchemy(app)
  
  
  class sms(db.Model):
      __tablename__='data_entry'
      id = Column(Integer, Sequence('data_entry_id_seq'), primary_key=True)
      latitude = db.Column(db.Float(),nullable=False)
      longitude = db.Column(db.Float(),nullable=False)
      date_of_fire = db.Column(db.DateTime(),nullable=False)
      fire_start_time = db.Column(db.Time(),nullable=False)
      def __init__(self,latitude,longitude,date_of_fire,fire_start_time):
          self.id
          self.latitude=latitude
          self.longitude=longitude
          self.date_of_fire=date_of_fire
          self.fire_start_time=fire_start_time
  
  
  
  @app.route('/SMS',methods=['POST'])
  def psms():
      smsdata=request.get_json()
      stringtemp=smsdata[&quot;smsString&quot;]
      value=smsdata[&quot;smsString&quot;].rfind(&quot;(&quot;)
      valueEnd=smsdata[&quot;smsString&quot;].rfind(&quot;)&quot;)
      finalValue=smsdata[&quot;smsString&quot;][value+1:valueEnd]
      last=finalValue.split(&quot;,&quot;)
      print(last)
      latitude=last[0]
      longitude=last[1].lstrip()    
      latitude = sum(float(x) / 60 ** n for n, x in enumerate(latitude[:-1].split(' ')))  * (1 if 'N' in latitude[-1] else -1)
      longitude = sum(float(x) / 60 ** n for n, x in enumerate(longitude[:-1].split(' ')))  * (1 if 'E' in longitude[-1] else -1)
      print(latitude,longitude)
      matchdate= re.search(r'\d{2}-\d{2}-\d{2}', stringtemp)
      matchtime= re.search(r'\d{2}:\d{2}:\d{2}', stringtemp)
      finaldate=matchdate.group()
      finaldate=datetime.strptime(finaldate,'%d-%m-%y').strftime(&quot;%Y-%m-%d %H:%M:%S&quot;)
      finaltime=matchtime.group()
      finaltime = datetime.strptime(finaltime,'%H:%M:%S').time()
  
      print(finaldate,finaltime)
  
      msg= sms(latitude=latitude,longitude=longitude,date_of_fire=finaldate,fire_start_time=finaltime)
      db.session.add(msg)
      db.session.commit()
  
      return jsonify(smsdata)
  </code></pre>
  <p>An error was thrown which is like this</p>
  <pre><code> * Serving Flask app 'new_app' (lazy loading)
   * Environment: production
     WARNING: This is a development server. Do not use it in a production deployment.
     Use a production WSGI server instead.
   * Debug mode: off
  Usage: python -m flask run [OPTIONS]
  Try 'python -m flask run --help' for help.
  
  Error: While importing 'new_app', an ImportError was raised.
  </code></pre>
  <p>Can someone help me out with this.</p>