I programmed a flask backend, and made it work on my local network (wifi, ethernet etc). However I can't manage to expand it so external searches reach it. The code for the backend looks like this:
import os
from flask import Flask, flash, request, redirect, url_for, send_from_directory
from waitress import serve
other imports...
app = Flask(__name__)
app.secret_key = os.urandom(24)
.....
if __name__ == '__main__':
serve(app,host='0.0.0.0',port=5000)
How should I give the server an external IP?
If I can make a suggestion, did you try using gevent? It provides a WSGI standalone server for you to replace the built-in option shipped with Flask.
It is very straightforward to use it:
And you can plug into your app like this:
Gevent also provides support for SSL
You can use it on its own or along with gunicorn or circusd I hope it helps you!