随笔分类 -  Python

Python--Django--Pexpect
摘要:Install Basic usage 在一个项目中创建一个虚拟环境 也可以创建一个指定python版本解释器的虚拟环境 开始使用之前需要先激活 如果完成工作后需要取消激活,返回系统默认的python解释器环境. 其他要点 执行 将不会将系统安装的包复制到虚拟环境中 如果需要保证环境的一致性,最好的 阅读全文
posted @ 2016-04-15 09:28 forilen 阅读(234) 评论(0) 推荐(0)
摘要:之前就着手开始尝试用django来简化web开发的流程周期,果不其然,速度还行,当然前期的产品那就相当粗糙了。举例来说,就连最基本的登录都是抄别人的,最可怕的是用GET方法提交表单,今天就尝试解决这个问题,用POST方法来提交登录数据。做过web开发的都知道相对而言,POST方法比GET方法更安全,... 阅读全文
posted @ 2015-08-23 00:06 forilen 阅读(400) 评论(0) 推荐(0)
摘要:一、系统环境版本介绍:os-version: Linux 3.10.0-229.el7.x86_64python-version: Python 2.7.5six-version: python-six-1.3.0-4.el7.noarchdocker-version: docker-1.6.2-1... 阅读全文
posted @ 2015-08-14 17:05 forilen 阅读(2341) 评论(0) 推荐(0)
摘要:一、staticmethod(function)Return a static method for function.A static method does not receive an implicit first argument. To declare a static method, u... 阅读全文
posted @ 2015-04-29 11:21 forilen 阅读(328) 评论(0) 推荐(0)
摘要:with从Python 2.5就有,需要from __future__ import with_statement。自python 2.6开始,成为默认关键字。在What's new in python2.6/3.0中,明确提到:The ‘with‘ statement is a control-f... 阅读全文
posted @ 2015-04-23 16:58 forilen 阅读(541) 评论(0) 推荐(0)
摘要:1. 下载源码:https://codeload.github.com/django/djangoproject.com/zip/master2. 本地解压3. 下载python2.7 install https://www.python.org/downloads/3.1 yum安装zlib-de... 阅读全文
posted @ 2015-03-29 16:19 forilen 阅读(520) 评论(0) 推荐(0)
摘要:操作系统:Linux wiki 2.6.32-131.0.15.el6.x86_64nginx版本:nginx-1.5.7uwsgi版本:uwsgi-2.0.8大致流程参考:http://www.linuxyw.com/353.html(官方文档:http://uwsgi-docs.readthed... 阅读全文
posted @ 2015-01-22 20:11 forilen 阅读(2397) 评论(0) 推荐(0)
摘要:html中用户输入信息,由Django的view.py处理,大致用到了以下几类格式:1. 文本框或由bootcss修饰的这种相对比较简单version_num=request.GET.get("vid")2. 文本框粘帖需要发布的其他所有UI这种要这样接收,返回结果是一个列表,相对比较好处理 ... 阅读全文
posted @ 2015-01-16 18:05 forilen 阅读(1239) 评论(0) 推荐(0)
摘要:python version 2.6.6 ; pexpect 2.3login方法解读:def login (args, cli_username=None, cli_password=None): # I have to keep a separate list of host names ... 阅读全文
posted @ 2015-01-09 15:35 forilen 阅读(387) 评论(0) 推荐(0)