기본 콘텐츠로 건너뛰기

Pycharm에서 flask로 개발할 때, 포트 변경하는 방법

Pycharm에서 flask로 개발할 때, 포트 변경하는 방법

Pycharm에서 flask로 개발할 때, 포트 변경하는 방법

Additional options

Parameters of the flask run command.

--host – the IP address of the web server to run your Flask application on. The default value is '127.0.0.1'. To make your web server externally visible, use the '0.0.0.0' value for this parameter.

--port – the port of the web server. The default value is 5000 or it is the port number set in the SERVER_NAME config variable.

Example: --host=127.0.0.2 --port=1234.

= ===============================================================

CLI로 Flask 서버를 기동할 때에 아래와 같은 파라미터를 주어 아이피와 포트를 변경할 수 있다. 정황에 따라서 스크립트에 아이피, 포트 정보를 기입하고 스크립트를 실행하면 될 거 같다.

python3.7 manage.py runserver --host=127.0.0.1 --port=8090

위의 명령어는 manage.py 파일이 있는 디렉토리에서 실행을 해주어야 한다. (당연하겠지만, )

결론:

역시 pycharm의 documentation을 보아야 한다.

https://www.jetbrains.com/help/pycharm/run-debug-configuration-flask-server.html#

from http://www.rdf.or.kr/163 by ccl(A) rewrite - 2020-03-07 01:54:36

댓글

이 블로그의 인기 게시물

Flask 13. pythonanywhere에 배포하기

Flask 13. pythonanywhere에 배포하기 Login: PythonAnywhere It's always a pleasure to hear from you! Ask us a question, or tell us what you love or hate about PythonAnywhere. We'll get back to you over email ASAP. Sorry, there was an error connecting to the server. Please try again in a few moments... www.pythonanywhere.com from http://ohdowon064.tistory.com/124 by ccl(A) rewrite - 2020-03-11 15:54:10

[ubuntu] FLASK_APP

[ubuntu] FLASK_APP Development/Debugging 🐞 FLASK_ENV=development FLASK_APP = app.py flask run zsh: command not found: FLASK_APP ✔️ FLASK_ENV=development FLASK_APP=app.py flask run 띄어쓰기를 해서 저런 오류를 출력할수도 있구나 😲 참고 : 108p에서 FLASK가 FKAS로 오타나있다. from http://hee-stories.tistory.com/18 by ccl(A) rewrite - 2020-03-24 17:20:11