1

I'm currently trying to deploy my website following the tutorial. But I'm having some accessibility issue:

For my application, even though listening on 0.0.0.0, it is still not accessible through external IP addresses:

$ flask run --host 0.0.0.0
 * Environment: development
 * Debug mode: on
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: xxx-xxx-xxx
/fakepath/.venv/lib/python3.8/site-packages/flask/sessions.py:220: UserWarning: The session cookie domain is an IP address. This may not work as intended in some browsers. Add an entry to your hosts file, for example "localhost.localdomain", and use that instead.
  "The session cookie domain is an IP address. This may not work"
127.0.0.1 - - [08/Dec/2019 17:20:03] "GET / HTTP/1.1" 200 -
xxx.xxx.xxx.xxx - - [08/Dec/2019 17:20:05] "GET / HTTP/1.1" 404 -  # external IP address of the host
$ curl http://127.0.0.1:5000
<html> ...  # correct page
$ curl http://xxx.xxx.xxx.xxx:5000  # external IP address of the host
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>

However, when I try using a Hello World application from DigitalOcean, it's actually working as the tutorial says.

Environment

  • Ubuntu 18.04
  • Python 3.8
  • Flask 1.1.1
  • Flask-Babel 0.12.2
  • Flask-Caching 1.8.0
  • Flask-Login 0.4.1
  • Flask-Mail 0.9.1
  • Flask-WTF 0.14.2
  • Werkzeug 0.16.0
Jarry Shaw
  • 81
  • 6

0 Answers0