
经验之谈的笔记,有问题留言。 经验: 1.服务器在年中6月或者年尾租,有优惠。 2.Django搭建尽量用virtualenv,这样在里面随便折腾,搞错了,直接删掉重新来就可以了。 下面开始步骤: 1.virtualenv安装和创建方面,参照:点击打开链接 2.Django安装、创建方面,参照:点击打开链接 默认情况下,照着上面做,做到命令 python manage.py runserver 0:8888 的时候,用外网通过服务器的ip访问(http://147.193.19.36:8888/)是访问不了的。会遇到如下错误。 错误一: from django.conf.urls import *找不到patterns模块? 解决: 打开文件, 改成下面这样: 参照的解决办法原文如下:这个特性在1.9就声明了deprecated. 1.10正式移除了。使用 django 1.10 需要改用 django.conf.urls.url() 示范代码: from django.conf.urls import url from . import views urlpatterns = [ url(r'^articles/2003/$', views.special_case_2003), url(r'^articles/([0-9]{4})/$', views.year_archive), url(r'^articles/([0-9]{4})/([0-9]{2})/$', views.month_archive), url(r'^articles/([0-9]{4})/([0-9]{2})/([0-9]+)/$', views.article_detail), ] 错误二:访问出现400错误: 解决: 在里面增加下面这个: 这样就可以了。 其他的好像没有什么太难的了。 如果推出runserver之后,再运行提示端口被使用的问题。 用如下命令,杀掉即可。例子为1111,根据实际情况改成实际查到的。 ps aux | grep -i manage kill -9 1111
我的博客即将入驻“云栖社区”,诚邀技术同仁一同入驻。
在file中选择export,出现如下菜单。 选择Projects from Folder or Archive.即可。
公司开发环境使用的是Ubuntu/debian,经常打包成tar文件,导致在window使用winrar和7-zip都无法很好的解压,甚至解压后出现一个无法使用的文件,现在有一个新的免费软件可以替代了: Bandizip多国语言,自带简体中文,免费、高效、跨平台,体验良好 附:异次元评测:http://www.iplaysoft.com/bandizip.html 官方网站: http://www.bandisoft.com/bandizip/ (文件托管在Google code 会导致经常被伟大的GFW干掉,不过异次元提供了替换下载地址,也可以使用我的百度网盘分享:http://pan.baidu.com/s/1eQ7QXOm)
先看成品效果图: 第一步:创建Grid List Box 3D, or Grid List Box 2D;2D就行了。 第二步: 创建含有图片、名字和号码三个元素的模板。然后用这个模板创建电话簿列表。 创建完后会变成下面这样,这是因为默认的行和列的个数。 第三步:修改宽窄尺寸,使得呈现为列表显示。似乎修改grid的行数和列数应该也可以改为列表显示的。 第四步:设置起始和终止区域。 这样基本就可以了。在此基础上将text显示一样的项目,设置为bind。再添加page的跳转。就可以了。 下面是通过脚本的方式创建: //To create a Grid List Box 2D: // Create a Grid List Box 2D named MyListBox. GridListBox2DSharedPtr gridListBox = GridListBox2D::create(domain, "MyListBox"); //To configure the grid area: // Make each grid cell be a 100x100 square. gridListBox->setCellWidth(100.0f); gridListBox->setCellHeight(100.0f); // Make the grid contain three rows that are filled column by column. gridListBox->setHeight(300.0f); gridListBox->setDirection(GridListBoxConcept::GridDirectionDown); // Make the grid contain 10 columns. Items that are dragged beyond these columns are made invisible. gridListBox->setWidth(1000.0f); // Change the resting position when the list is scrolled to the beginning or end, so that items are not right at the grid edge. gridListBox->setItemAreaBegin(0.2f); gridListBox->setItemAreaEnd(0.8f); //To add items to the list box: // Create images and add them as items of the list box. // Items on the grid appear in the order you add them to the list. for (int i = 0; i < 5; ++i) { Image2DSharedPtr item = Image2D::create(domain, "item" + to_string(i)); item->setImage(item->acquireResource<Texture>(ResourceID("DefaultTexture"))); // Make the images shrink to the cell size. item->setHorizontalAlignment(Node::HorizontalAlignmentStretch); item->setVerticalAlignment(Node::VerticalAlignmentStretch); gridListBox->addItem(item); }