Python/Django学习笔记(2):感受Django框架

就像学习Ruby语言的主要动力来自RubyOnRails框架一样,学习Python语言是因为要用它来开发Web应用,而Django框架显然是首选。

搭建Django开发环境

    1. 下载 django (0.96.1)

    2. 按照安装文档 进行配置。
   
       这方面有价值的文档还有:

       Using Eclipse and PyDev for django

       安装配置Django开发环境(Eclipse + Pydev)(2008.4)
      
       使用Eclipse+PyDev+EclipseHtmlEditor搭建Django开发环境

       在Windows上安装Django

    3. 注意要在 Path 中加入 python 安装路径.

    4. 还要在 Path 中加入 <python 安装路径>\Lib\site-packages\django\bin 路径。

跟着教程走一遍

    1. 从这篇教程 开始。

    2. 基本过程如下:

       第1步: 创建项目
       第2步: 创建models
       第3步: Activate the admin site
       第4步: 创建view
       第5步: 创建表单(仅浏览)

    3. 模拟出Eclipse的调试功能。
     
        安装配置Django开发环境(Eclipse + Pydev)

阅读有关Django的资料

   1. 阅读《Next-Generation Web Frameworks in Python》 (April 9, 2007出版)

      其中有关Django的内容摘录如下:

      -- Django advocates a "model-centric" approach to development

      -- Django is different—it considers the view layer to be a combination of the
         templates and some backing Python methods in views.py.

      -- If Django has a controller layer (other than Django itself), it is the URL mapper.
         One Django design philosophy is to decouple the visible URLs in the browser from
         the application itself. This facilitates deployment and allows changes to the URL
         mapping to be independent of the methods that handle those URLs. This feature is
         configured in urls.py:
 


   2. 阅读《Professional Python Frameworks: Web 2.0 Programming with Django and Turbogears》(2007.10出版)
     
      书中有一个完整的blog例子可以参考并作为学习例子(AJAX+RSS)。

   3. 阅读《The Definitive Guide to Django: Web Development Done Right》(December 2007出版)
     
      第一遍阅读可能不一定能都懂,先花1天时间通读一遍。

对Django框架的评估

    1. 与RubyOnRails的比较

        Of snakes and rubies; Or why I chose Python over Ruby

        Constructive reasons to use Django instead of Rails

    2. 部分Django资源:

        python-cn`CPyUG`华蟒用户组

    3. 关注Django的热部署问题。能否做到程序更新后自动加载呢?

       Python Module Auto Reload

       这个问题暂时没有结果。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值