错误:在Django中无法分配IP地址? [英] Error: That IP address can't be assigned-to in Django?

查看:3726
本文介绍了错误:在Django中无法分配IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Debian 6 stable,我正在使用 ./ manage.py runserver 命令在本地运行Django。这是我得到的:

 验证模型... 

0找到错误
Django版本1.4.1,使用设置'genelaytics.settings'
开发服务器正在运行http://127.0.0.1:8000/
使用CONTROL-C退出服务器。
错误:该IP地址无法分配给。

我尝试创建一个新的django项目,仍然得到相同的错误。有什么问题?昨天刚刚重新安装Debian,由于这个问题。这个问题还没有消失。如何解决?

解决方案

您在网络配置文件中缺少两行代码。使用任何文本编辑器以root用户身份编辑文件:

  sudo gedit / etc / network / interfaces 

添加以下两行:

  auto lo 

iface lo inet loopback

使用以下命令:

  sudo /etc/init.d/networking restart 

现在,本地服务器可以正常工作。


I am running Debian 6 stable and I am trying to run Django locally using ./manage.py runserver command. This is what I get:

Validating models...

0 errors found
Django version 1.4.1, using settings 'genelaytics.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Error: That IP address can't be assigned-to.

I tried creating a new django project, still get the same error. What's the problem? I just fresh re-installed Debian yesterday because of this problem. This problem hasn't gone away. How can I fix it?

解决方案

You are missing two lines of code in network configuration file. Edit the file as a root user with any text editor:

sudo gedit /etc/network/interfaces

Add these two lines:

    auto lo

    iface lo inet loopback

Restart the network using the following command:

sudo /etc/init.d/networking restart

Now, the localserver will work fine.

这篇关于错误:在Django中无法分配IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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