title: Moving from localhost to real URL in Flask?
body: <p>I'm developing a site with Python and Flask and want to move from localhost in my browser to my team's development server and development site but I'm having problems. I've already looked at the Flask documentation, which recommends using <code>host='0.0.0.0'</code> or specifying <code>SERVER_NAME</code>. Thusfar, neither of these things have helped. Here's a bit of code to show what I'm doing:</p>
  
  <pre><code>app = Flask(__name__)
  
  if __name__ == '__main__':
      app.secret_key = 'super secret key'
      app.config['SERVER_NAME'] = 'https://example.org/blah'
      app.run(host=app.config['SERVER_NAME'], port=4343, debug=True)
  </code></pre>
  
  <p>As you can see, instead of <code>localhost:500</code>, I want to be able to go into my browser and visit <code>'https://example.org/blah'</code> and see the same things. </p>
  
  <p>With this piece of code, I get this error:</p>
  
  <pre><code>(py34)user:~/flask$ python app.py
  INFO - Connection with server established!
  INFO - Server version meets recommendations (v2.9)
  Traceback (most recent call last):
  File "app.py", line 18, in &lt;module&gt;
  app.run(host=app.config['SERVER_NAME'], port=4343, debug=True)
  File "/home/me/anaconda3/envs/py34/lib/python3.4/site-packages/flask/app.py", line 772, in run
  run_simple(host, port, self, **options)
  File "/home/me/anaconda3/envs/py34/lib/python3.4/site-packages/werkzeug/serving.py", line 674, in run_simple
  s.bind((hostname, port))
  socket.gaierror: [Errno -2] Name or service not known
  </code></pre>
  
  <p>If instead of using <code>SERVER_NAME</code> I use <code>host='0.0.0.0'</code>, I don't get any errors and it will successfully start <code>"Running on http://0.0.0.0:4343/"</code> but I can't follow that url into my browser the same way I can when I connect to my localhost.</p>
  
  <p>What do I need to do to get my flask app running on <code>https://example.org/blah</code>? </p>
  
  <p>Also, if it helps to know, I have to <code>ssh</code> into my server.   </p>