flask manage.py runserver can't pass parameter

kaku21 picture kaku21 · Mar 10, 2015 · Viewed 15.7k times · Source

user manager.py runserver my flask webframework can start on http://127.0.0.1:5000 but it can not access on other computer in network. so i need use an open IP in network. although i use bellow command:

manage.py runserver 192.168.49.25:8000

it can not run and give a error info:

manage.py: error: unrecognized arguments: 192.168.49.25:8000

I don't known what's wrong with it??

Answer

matyas picture matyas · Nov 13, 2015

If you want to use Flask-Script (python manage.py runserver) to run your Flask Application you can use the parameter --host to run it on a public IP.

python manage.py runserver --host 0.0.0.0 

see also: https://flask-runner.readthedocs.org/en/latest/