摘要: 一. 安装 比较纠结,按照网上的装法总是Connection Refused ,但是看redis却是启动的状态,没有任何其他的错误信息,于是装了卸卸了装,折腾好半天,最后决定先在Mac里装吧,结果过程与其相同,原来是版本问题呀,晕~然后原样在Ubuntu也装撑了。 cd /tmp wget http://redis.googlecode.com/files/redis-2.6.9.tar.gz tar zxf redis-2.6.9.tar.gz cd redis-2.6.9 make sudo make install make test:看时候通过然后下载一些配置文件(主要就是把d... 阅读全文
posted @ 2013-12-06 13:45 画家与我 阅读(111) 评论(0) 推荐(0) 编辑
摘要: url(r'^static/(?P.*)$',django.views.static.serve,{'document_root':settings.STATIC_ROOT}),} 阅读全文
posted @ 2013-12-06 13:39 画家与我 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Brett.IsBlogging about all kinds of thingsMy Python Web Crawlerwritten by brett langdonHow to write a very simplistic Web Crawler in Python forfun.Recently I decided to take on a new project, a Python basedweb crawlerthat I am dubbing Breakdown. Why? I have always been interested in web crawlers and 阅读全文
posted @ 2013-12-04 12:53 画家与我 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 1.sudo apt-get install apache2 sudo apt-get install php5 sudo apt-get install libapache2-mod-php5sudo apt-get install libapache2-mod-auth-mysql sudo /etc/init.d/apache2 restartsudo apt-get install libapache2-mod-python apt-get remove --purge apache2.2-common, 阅读全文
posted @ 2013-12-03 17:10 画家与我 阅读(111) 评论(0) 推荐(0) 编辑
摘要: urllib.unquote()字符串被当作url提交时会被自动进行url编码处理,在python里也有个urllib.urlencode的方法,可以很方便的把字典形式的参数进行url编码。可是在分析httpheaders的传输信息时,很多已经被url编码的字符串,不是我们这些菜鸟一眼能看出来的,于是乎,urllib.unquote()s ="url=%2F&email=imtesting%40tempmail.com&password=hereispassword"print urllib.unquote(s)>>> url=/& 阅读全文
posted @ 2013-12-03 16:05 画家与我 阅读(435) 评论(0) 推荐(0) 编辑
摘要: python中对文件、文件夹(文件操作函数)的操作需要涉及到os模块和shutil模块。得到当前工作目录,即当前Python脚本工作的目录路径:os.getcwd()返回指定目录下的所有文件和目录名:os.listdir()函数用来删除一个文件:os.remove()删除多个目录:os.removedirs(r“c:\python”)检验给出的路径是否是一个文件:os.path.isfile()检验给出的路径是否是一个目录:os.path.isdir()判断是否是绝对路径:os.path.isabs()检验给出的路径是否真地存:os.path.exists()返回一个路径的目录名和文件名:os 阅读全文
posted @ 2013-12-03 12:55 画家与我 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 首先建立项目,XXX按照github上的命令行提示:(1)终端上将项目克隆到本地,git clone https://github.com/username/projectname.git (2)touch README.md (3)git init: 【Initialized empty Git repository in /home/song/code/.git/】(4)git add README.md (5)git commit -m "first commit" (6)cd 项目 git remote add originhttps://github.com/us 阅读全文
posted @ 2013-12-02 19:23 画家与我 阅读(188) 评论(0) 推荐(0) 编辑
摘要: from reportlab.pdfgen import canvasdef some_view(request): response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] ='attachement;filename=somefilename.pdf' p = canvas.Canvas(response) p.drawString(100,100,"Hello World.") p.showPage() p.sa 阅读全文
posted @ 2013-12-01 22:47 画家与我 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 首先配置Django环境,下个包解压就行了: tar xzvf Django-1.6.tar.gz cd Django-1.6 sudo python setup.py install 然后安装MySQL:ubuntu中, sudo apt-get install mysql-server sudo apt-get install mysql-client 这样就完成了所需的软件。 setting中,修改engine为.mysql,用户名和密码,如果不确定密码, mysql -u root -p试... 阅读全文
posted @ 2013-11-27 21:54 画家与我 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 素人贴,比较白痴,还是骚微记下来吧,网上搜svn提交,大部分给出svn ci -m "提交理由" 的方案,但是由于白天Google服务器不好连,就以为行不通,偶然连上,提示输入用户名密码,出现403,权限问题,验证不通过,最后终于在https://code.google.com/hosting/settings 找到了密码,呵呵呀。。。 比较简单的一种方法是在eclipse中创建SVN项目,检出SVN代码,然后修改之后提交就可以鸟,右键->Team->提交,很方便,不需要部署机器了,不过要小心备份,改了就只能回到上一个版本了,所以如果是一个人写的话建议勤提交。 阅读全文
posted @ 2013-11-27 10:59 画家与我 阅读(206) 评论(0) 推荐(0) 编辑