`
fangzhouxing
  • 浏览: 211284 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

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

       这个问题暂时没有结果。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics