Ati*_*hay 1 python django networking android
我的PC上运行着django服务器。我想通过我的Android手机访问服务器,该怎么办?我尝试跑步
python manage.py runserver 0.0.0.0:8000。
此后,我可以通过PC的IP地址从我的PC访问服务器,但是无法通过连接到同一wifi的其他设备访问服务器。
你能试试吗python manage.py runserver youripadress:8000[ python manage.py runserver 192.168.0.1:8000]
您需要执行以下步骤
1. run python manage.py runserver 0.0.0.0:8000
2. figure out your ip address which is say 192.168.1.8
3. Add '192.168.1.8' to ALLOWED_HOSTS list in your settings.py file.
4. access 192.168.1.8:8000 on mobile.
Run Code Online (Sandbox Code Playgroud)
我试过了,它对我有用。
| 归档时间: |
|
| 查看次数: |
2347 次 |
| 最近记录: |