上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
摘要: [root@test mysql]# vi /etc/rc.d/rc.local# 将底下这一行加入这个档案的最后面一行喔!cd /usr/local/mysql; /usr/local/mysql/bin/safe_mysqld --user=mysql & 阅读全文
posted @ 2012-01-02 00:17 SophiaTang 阅读(145) 评论(0) 推荐(0) 编辑
摘要: http://nginx.org/packages/rhel/5/x86_64/RPMS/ 阅读全文
posted @ 2012-01-01 17:21 SophiaTang 阅读(114) 评论(0) 推荐(0) 编辑
摘要: django 模板的乘法,除法1人收藏此文章,收藏此文章发表于11个月前 , 已有141次阅读 共0个评论1人收藏此文章Note: The results are rounded to an integer before returning, so this may have marginal utility for many cases.So, in summary:to compute A*B: {% widthratio A 1 B %}to compute A/B: {% widthratio AB 1 %}And, since add is a filter and not a ta 阅读全文
posted @ 2011-12-31 00:36 SophiaTang 阅读(1025) 评论(0) 推荐(0) 编辑
摘要: 原文地址是:http://zeroandone.posterous.com/top-10-tips-to-a-new-django-developer1,不要将项目名称包含在引用代码里比如你创建了一个名为"project"的项目,包含一个名为"app"的应用,那么如下代码是不好的:Python代码fromproject.app.modelsimportAuthor缺点在于:应用和项目变成了紧耦合,无法将应用轻易变得可重用。如果将来要换一个项目名称,那你可有得受了。推荐的做法是:Python代码fromapp.modelsimportAuthor请注意,你 阅读全文
posted @ 2011-12-31 00:32 SophiaTang 阅读(444) 评论(0) 推荐(0) 编辑
摘要: 1.mkdir( path [,mode] ) 作用:创建一个目录,可以是相对或者绝对路径,mode的默认模式是0777。 如果目录有多级,则创建最后一级。如果最后一级目录的上级目录有不存在的,则会抛出一个OSError,例如: import osos.mkdir( './image' ) # successful# if ./download exits, successful# elsefailed, get aoserrortry : os.mkdir( 'download/image' )except OSError, why : print " 阅读全文
posted @ 2011-12-30 13:33 SophiaTang 阅读(1268) 评论(0) 推荐(0) 编辑
摘要: Web开发中需要了解的东西2011年12月7日 陈皓 发表评论 阅读评论 18,349 人阅读 在StackExchange上有人问了这样一个问题:What should every programmer know about web development?(关于Web开发,什么是所有程序员需要知道的?)里面给出的答案非常不错,所以,我翻译转载过来。顺便说一下,StackExchange真是非常好,大家可以对同一个答案做贡献和修订,看看这个问题的修订过程你就知道了——专业的问答网站应该怎么去做。这就是我在这篇文章中也说过真正的用户体验是什么样的。好了,下面是正文(我对原文做了一些批注,也许. 阅读全文
posted @ 2011-12-23 00:25 SophiaTang 阅读(139) 评论(0) 推荐(0) 编辑
摘要: For every database, you should set the root or sa passwords to something other than the default, unless you want to get hacked. For mysql, the system administrator user is called root. You will use the mysqladmin utility from a command line to set the new password. Notice that there are two commands 阅读全文
posted @ 2011-12-22 15:26 SophiaTang 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 这个可选的宽度规格说明是用于在数值显示时,对某些值的宽度短于该列宽度的值进行左填补显示的,而不是为了限制在该列中存储值的宽度,也 不是为了限制那些超过该列指定宽度的值的可被显示的数字位数。注意,如果在一个整型列中存储一个超过显示宽度的更大值时,当mysql为某些复杂的联结(join)生成临时表时,你可能会遇到问题,因为在这种情况下,mysql信任地认为所有的值均适合原始的列宽度。而int本身就是4个字节 bigint是8个字节 所以说int(X)的含义就是 int决定数据存储的字节 X表示期望数据的列宽度在SQL语句中int代表你要创建字段的类型,int代表整型,11代表字段的长度。这个代表显 阅读全文
posted @ 2011-12-22 14:52 SophiaTang 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 参考http://docs.djangoproject.com/en/dev/topics/db/models/简介Model 描述了数据模型,通过 Python 的类实现与关系数据库的对应(即著名的 ORM — Object Relation Mapping)。通常,我们定义的每个 Model 对象都对于 一个数据库表。每个 Model 都是 django.db.models.Model 的子类Model 对象的每个属性都是数据表中的一个区域通过这些对应,Django 可以自动同数据库交互 (请参考:Making queries -- 模型数据库查询)Quick example假设有如下 m 阅读全文
posted @ 2011-12-22 14:46 SophiaTang 阅读(6244) 评论(0) 推荐(1) 编辑
摘要: mysql> DESCRIBE city;+------------+----------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+------------+----------+------+-----+---------+----------------+| Id | int(11) | NO | PRI | NULL | auto_increment || Name | char(35) | NO | | | || Country | char(3 阅读全文
posted @ 2011-12-22 14:15 SophiaTang 阅读(1537) 评论(0) 推荐(1) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页