本地托管Django项目 [英] Locally hosting Django project

查看:38
本文介绍了本地托管Django项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我试图在本地托管我正在处理的Django项目.

So I'm trying to locally host a Django project that I am working on.

我希望能够使所有连接到本地网络的计算机都能够访问此django应用程序/webapp.有点像一个中央的,内部的,本地的唯一网站/集线器.而且我想知道如何才能建立自己的项目来做到这一点.

I'm looking to have the ability to have all computers who are connected to the local network be able to access this django app/webapp. Sort of like a central, internal, local only website/hub. And I was wondering how I could go about setting up my project to be able to do this.

我需要设置一个网络服务器来完成此功能吗?如果是这样,您可以推荐任何东西吗?我可以使用开发服务器在Django本身中执行此操作吗?任何帮助将不胜感激.

Would I need to setup a webserver to accomplish this functionality? If so would you be able to recommend any? Can I do this within Django itself using the dev server? Any help would be greatly appreciated.

谢谢您的时间.

推荐答案

当然可以.运行django项目时,请传递服务器ip地址和端口(如果未使用默认端口).

Of course it can be done. When you run the django project, pass on the server ip address and port (if you are not using the default port).

python manage.py runserver x.x.x.x:8080

其中 x.x.x.x 是ip, 8080 是端口.

现在,您所需要做的就是在网络连接设备上的浏览器中输入 x.x.x.x:8080 .

Now all you need is to enter x.x.x.x:8080 in browser on the network connected device.

有关更多详细信息,请阅读此文档

这篇关于本地托管Django项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆