简体   繁体   English

Manage.py Runserver进行演示

[英]Manage.py runserver for demonstration

How would I run a Django application on, a digitalocean droplet let's say, with just using the development server Django provides. 仅仅使用Django提供的开发服务器,如何在Digitalocean上运行Django应用程序。 I've tried just running python3 manage.py runserver, but I can't pull it up with the browser from another computer 我已经尝试过仅运行python3 manage.py runserver,但无法通过浏览器从另一台计算机上将其启动

I know this is bad practice, but I really only need it up to demonstrate for a class project 我知道这是不好的做法,但是我真的只需要用它来演示一个课堂项目

by default runserver only listn on 127.0.0.1 that is not accessible from remote computer. 默认情况下,runserver仅在远程计算机无法访问的127.0.0.1上列出。

run

python3 manage.py runserver 0.0.0.0:8000

will solve it, simply check the real IP if the machine and use it as address in your browser 将解决它,只需检查机器的真实IP并将其用作浏览器中的地址

python3 manage.py runserver <your IP address>:8000

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

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