简体   繁体   English

如何提供代码需要的特定IP和端口

[英]How can I give specific IP and port that my code requires

In django I am using python osc, using osc server which required IP address and Port no. 在Django中,我使用的是python osc,使用的osc服务器需要IP地址和端口号。 to run. 跑步。

When I run that specific file on terminal I add the ip and port like: 当我在终端上运行该特定文件时,我添加了IP和端口,例如:

OSC.py --ip --port

Now I want to implement this in django but don't know where to add ip and port 现在我想在Django中实现它,但是不知道在哪里添加ip和port

If you are talking about python manage.py runserver command then you can pass the ip and port number as well. 如果您正在谈论python manage.py runserver命令,那么您也可以传递ip和端口号。
Ex-1: python manage.py runserver 192.168.0.100:5001 范例1: python manage.py runserver 192.168.0.100:5001
Ex-2: python manage.py runserver 5001 # only port overriding 例2: python manage.py runserver 5001 #仅端口覆盖
Ex-3: python manage.py runserver 192.168.0.100 # ip only 例3: python manage.py runserver 192.168.0.100 #仅IP

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM