Professional Python Frameworks - Web 2.0 Programming with Django and TurboGears

时间:2022-09-03 07:09:29
【文件属性】:

文件名称:Professional Python Frameworks - Web 2.0 Programming with Django and TurboGears

文件大小:10.32MB

文件格式:PDF

更新时间:2022-09-03 07:09:29

Professional Python  Frameworks  Programming  TurboGears

Contents Acknowledgments xiii Introduction xxi Part I: Introduction to Python Frameworks Chapter 1: Web 2.0, Python, and Frameworks 3 The Starting Line 4 What’s Web 2.0? 4 The History of Application Design for Content Creation (In One Easy Dose) 4 The Role of AJAX in Web 2.0 10 Leveraging the Power of DSLs 10 Leveraging the Power of TurboGears 11 Leveraging the Power of Django 12 Leveraging the Power of Python 12 Comparing the Frameworks 13 The Historical Perspective 13 Controller Invocation 14 Summary 17 Chapter 2: Web 2.0 with Traditional Python 19 Old-School Web Technologies 19 XML 19 HTML 21 HTTP 23 SQL 24 JavaScript 25 CGI and Python 25 A Simple Example 25 Architecture 29 The HTML Page 30 The JavaScript Code 33 The Database 38 The Python CGI Program 42 Summary 45 ftoc.indd xv 9/10/07 11:33:01 AM xvi Chapter 3: Introducing the Frameworks 47 Web Application Frameworks 48 MVC in Web Application Frameworks 48 Common Web Application Framework Capabilities 50 Introduction to TurboGears 52 TurboGears History 52 Main TurboGears Components 52 Alternate Components 53 MVC Architecture in TurboGears 53 Creating an Example Application 54 The Controller and View 61 Introduction to Django 71 Django History 71 Main Django Components 71 Alternate Components 72 MVC Architecture in Django 72 Creating an Example Application 73 Summary 92 Part II: TurboGears Chapter 4: Introduction to TurboGears 101 TurboGears Components 101 TurboGears Models (SQLObjects) 101 TurboGears Controllers 102 TurboGears Views (Kid Templates and MochiKit) 103 TurboGears Widgets 104 An Example: A Simple Blog Site 104 Creating the Project 105 Defining the Model 105 Using TGCrud 108 Creating the Blog Author Views with TGCrud 110 Creating the Blog Entry Views with TGCrud 118 Replacing the Blog Welcome Page 128 Changing Your Site’s Look and Feel 131 Summary 136 Chapter 5: User Identity and Visitor Tracking 137 Tracking Visits through Cookies 138 Managing User Identity 140 Contents ftoc.indd xvi 9/10/07 11:33:03 AM xvii User Identity Model Objects 140 Identity Configuration Options 143 Other Identity Framework Components 144 Using the Identity Model Objects 144 Using the Identity Module 150 Visitor Tracking 159 Visitor Tracking Model Objects 160 Visitor Tracking Configuration Options 161 Visitor Tracking Plug-Ins 162 Adding Visitor Tracking 162 Summary 168 Chapter 6: Widgets 169 TurboGears Widgets 170 Using the Widget Browser 172 Using Existing Widgets 173 Defining the Model Object 173 Accepting User Comments 174 Creating New Widgets 185 Creating a Simple Hello Widget 185 Creating a Comment Widget 189 Summary 201 Chapter 7: Advanced TurboGears Topics 203 Your Assignment 204 The Operational Concept 205 Designing the Model 206 TurboGears Toolbox 206 The Model 210 The Controller 216 The View 227 Adding RSS Feed Capability 234 Summary 237 Part III: Django Chapter 8: Dblog: A Blog Implemented in Django 241 Django Design Philosophies 241 An Example: A Simple Blog Site 242 Contents ftoc.indd xvii 9/10/07 11:33:03 AM xviii Initializing the Project 242 Initializing the Application 245 Creating the Model 246 Exploring the Model with Django’s Admin Interface 251 Creating the Views 255 Summary 273 Chapter 9: Django Views and Users 275 Template Inheritance 276 The DRY Problem 276 Defining a Base Template 277 Using the {% extends %} Directive 279 Generic Views 282 List-Detail Generic Views 282 Other Generic Views 284 User Authentication and Authorization 285 Installing User Management 285 The User Model 286 Authenticating a User 287 Enhancing the Base Template 290 User Permissions 293 Creating a User 297 Summary 303 Chapter 10: Advanced Django Topics: AJAX, RSS, and More 305 AJAX and Django 306 MochiKit 306 Django Serialization for AJAX 307 AJAX-ified Blog Example 311 Django Add-Ons 320 django.contrib Add-Ons 320 Other Add-Ons 321 RSS in Detail 321 Deploying Django with Apache HTTPD 327 Installing and Configuring Apache 327 Configuring Other Items 328 Summary 329 Contents ftoc.indd xviii 9/10/07 11:33:03 AM xix Part IV: Advanced Client-Side Topics Chapter 11: MochiKit — Pythonic JavaScripting 337 Why MochiKit? 338 What Is MochiKit? 341 What’s Inside MochiKit? 341 MochiKit.Async 342 MochiKit.Base 349 MochiKit.DOM 351 MochiKit.Logging 352 MochiKit.Signal 352 MochiKit.Visual 355 MochiKit Miscellany 357 Summary 357 Chapter 12: Flash-Based Interfaces and TurboGears 359 The Flex Difference 359 What’s Flex and Why Should I Use It? 360 A Flex2-based Blog 380 The Supporting Model 381 The Application Controller 382 The Flex Front-End 384 FBlog’s MXML Implementation 385 Deconstructing FBlog 387 Summary 392 Appendix A: Tools Used 395 Index 405


网友评论