title: Python Flask app insists on running on default port 5000 despite attempts to change it
body: <p>As the title of my question says, I tried to set the port to something other than 5000. I tried two ways:</p>
  
  <ul>
  <li>in app.py I did this:</li>
  </ul>
  
  <pre><code>if __name__ == '__main__':
      app.run(port=5001)
  </code></pre>
  
  <ul>
  <li>In config.py I included the following line under class Config(object):</li>
  </ul>
  
  <pre><code>SERVER_NAME = "127.0.0.1:5001"
  </code></pre>
  
  <p>Neither worked and when I run my app I get</p>
  
  <pre><code>* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  </code></pre>
  
  <p><strong>EDIT:</strong> As an answer below has pointed out that the app.run() way of doing it seems to have been depracated, I was able to change the port by running the flask app with command line arguments. However, it would still be useful to me if I could hardcode the port in the config.py file itself. According to flask documentation, this method is still in use. But I'm not well informed on the details of using the config.py file so maybe I'm doing something wrong. I followed my teacher's sample code for that. He did the following in app.py:</p>
  
  <pre><code>from config import DevConfig
  app.config.from_object(DevConfig)
  </code></pre>
  
  <p>(DevConfig is a subclass of Config in the config.py file)</p>