我正在关注此website以将raspberry pi与网络服务器连接起来。所有步骤都正确完成,包括最后一步。然后我试着转到http://127.0.0.1:8000/,但是从chrome获得了这条消息: “无法访问此网站
127.0.0.1拒绝连接。 ERR_CONNECTION_REFUSED“
我不知道该怎么做所以只是将最后一个命令改为
python manage.py runserver 192.168.0.29:8000
(192.168.0.29是我的RPi inet地址) 然后chrome抛出这一行: “发生服务器错误。请与管理员联系。” 同时在RPi上,它扔了一个
ImportError: No module named 'django.middleware.security'
我该如何解决这个问题?感谢
答案 0 :(得分:1)
您是否通过运行 Window5::Window5(QWidget * parent) :QWidget(parent)
{
QPushButton * button1=new QPushButton("button1",this);
connect(button1, SIGNAL(clicked()), this, SLOT(make_pushed()));
//QButtonGroup * group1=new QButtonGroup(); //currently not in the group
// group1->addButton(button1);
QLineEdit * line_area=new QLineEdit(this);
line_area->setGeometry(500,500,70,20);
button1->setCheckable(true);
}
void Window5::make_pushed()
{
QObject* sender = QObject::sender();
QPushButton* button = qobject_cast<QPushButton*>(sender);
button->setDown(true);
if (button->isChecked())
{
button->setText("checked");
}
else
{
button->setText("unchecked");
}
实际设置了django项目?这应该正确地为您设置文件结构,然后您应该能够运行django startproject
并看到您的项目在运行ip / admin的管理服务时运行。
答案 1 :(得分:0)
你应该在你的pi上安装django。
使用pip
:
sudo pip install django
使用apt-get
sudo apt-get install python-django