网上很多关于django跟python 开发的资料,这块我正在实习准备用这个两个合起来搞一个基于web 的东西出来现在开始学习,写点东西记录一下心得。
Django 是围绕着 Request 与 Response 进行处理,也就是无外乎“求”与“应”。
1. 检查python是否安装:直接在shell里输入python,如果已经安装了python,即可进入python bash,并看到版本号(如Python 2.7.3)
安装所需要的源码包: • Apache 2.2.22 (http://labs.mop.com/apache-mirror//httpd/httpd-2.2.22.tar.gz) • Python 2.7.3 (http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz) • Mod_python 3.3.1 (http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz) • Django 1.4 (https://www.djangoproject.com/download/1.4.1/tarball/) 安装步骤 1. Apache安装 #tar -zxvf httpd-2.2.22.tar.gz # httpd-2.2.22 # ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite #make && make install 2. Python安装 # tar -zxvf Python-2.7.3.tgz #cd Python-2.7.3 # ./configure #make && make install #mv /usr/bin/python /usr/bin/python.bak #ln -s /usr/local/bin/python2.7 /usr/bin/python #python -V #版本显示2.7.3 3. django安装 # tar -zxvf Django-1.4.1.tar.gz #cd Django-1.4.1 #python setup.py install #执行没有报错,就说明安装成功 也可以检查是否成功 #python >> import django #这样import导入django模块没有报错,就安装成功 4. mod_python安装 # tar -zxvf mod_python-3.3.1.tgz # cd mod_python-3.3.1 #./configure \ --with-apxs=/usr/local/apache2/bin/apxs \ --with-python=/usr/local/bin/python2.7 #make #执行make的时候会报错,如下:
Django,发音为[`dʒæŋɡəʊ],Django诞生于2003年秋天,2005年发布正式版本,由Simon和Andrian开发。
我们在使用python做接口测试的时候,通常使用的是requests库。而大家都知道还有一个request东西,很多人对requests与request两个东西傻傻分不清。下面我简单来介绍一下。
“大神你好,请问我打算学习Django,应该怎么做?” 答:“去看文档” “Django的文档都是英文,我看不下去,怎么办” 答:“bla bla bla…. 关于英文的重要性” “Django的文档那么多,我是不是都得看完才行?” 答:“不用,用到哪看到哪,没事可以随意浏览” 上面的对话经常会出现在我的QQ消息框中,有很多初学Django的人通常都会有这样或者那样的疑问,我之前写过一篇 《从Django的Turotial中可以学到什么》 ,在那篇文章中我总结过,练习完这个新手入门教程,基本上可以独自开
django自带web server, 故django开发的项目可以独立的运行,也可以安置在apache(+mod_python)下运行
一直以来都在Qzone、CSDN等上面写博客,偶尔有些想法就在Paas平台上搭建服务,新浪和曾经的google上都用过其appengine。可是在别人的平台上写东西,总归有些不方便,有受制于人的感觉。《深入理解Nginx》这本书的在线支持站点,当时因为时间紧,就随便在weebly平台弄了个下载示例代码和写作勘误的页面,毕竟离有效的在线支持网站还是有差距的,至少读者不容易在网站上反馈。想到毕竟在阿里云的弹性计算工作,总不能都不用自己开发的产品吧?于是就买了阿里云的低端服务器,开始了我的第一次完整的建站历程。
HTML5 Canvas编程:http://blog.csdn.net/column/details/canvas-programming.html GTK编程基础学习:http://blog.csdn.net/column/details/sjin-gtk.html Git学习系列:http://blog.csdn.net/column/details/git-lover.html git学习笔记:http://blog.csdn.net/column/details/gitnote.html Git深入体验:http://blog.csdn.net/column/details/gitexperience.html Git菜鸟变大神:http://blog.csdn.net/column/details/lilongsheng-git.html GitHub 漫游指南:http://github.phodal.com/ 全栈增长工程师指南:http://growth.phodal.com/ 全栈增长工程师实战:http://growth-in-action.phodal.com/ Phodal’s Idea实战指南:http://ideabook.phodal.com/ JavaScript 闯关记:https://github.com/stone0090/javascript-lessons css知多少:http://www.cnblogs.com/wangfupeng1988/p/4325007.html Docker入门教程:http://dockone.io/article/111 HTTP cookies 详解:http://bubkoo.com/2014/04/21/http-cookies-explained/ HTTP 接口设计指北:https://github.com/bolasblack/http-api-guide http2讲解:https://bagder.gitbooks.io/http2-explained/content/zh/ innodb源码分析:http://blog.csdn.net/column/details/innodb-zerok.html JavaScript Promise迷你书(中文版):http://liubin.org/promises-book/ JavaScript:http://blog.csdn.net/column/details/js-lyg.html JavaScript权威指南:http://blog.csdn.net/column/details/webcode.html JavaScript设计模式:http://blog.csdn.net/column/details/design-pattern-of-js.html JavaScript设计模式浅谈:http://blog.csdn.net/column/details/js-patterns.html LGCB:http://happypeter.github.io/LGCB/ linux基础与shell编程:http://blog.csdn.net/column/details/linux-world.html Linux内核读书笔记:http://blog.csdn.net/column/details/linuxnotes.html Linux入门及进阶:http://blog.csdn.net/column/details/dxmy-linux.html Nginx开发:http://blog.csdn.net/column/details/sknginx.html PHP程序员技术精粹:http://blog.csdn.net/column/details/phpjingcui.html PHP入门到精通:http://blog.csdn.net/column/details/phpspecialcolumn.html python3入门学习:http://blog.csdn.net/column/details/python-spider.html Python大法好:http://blog.csdn.net/column/details/python-master.html Python入门学习:http://blog.csdn.net/column/details/enjoypython.html Python学习笔记:http://blog.csdn.net/column/details/python-notes.html scala 从入门到入门+:https://segmentfault.com
领取专属 10元无门槛券
手把手带您无忧上云