36
Build Python CMS The Plone Way 胡胡胡 marr marr.tw @ gmail.com Fork Me If You Da

Build Python CMS The Plone Way

Embed Size (px)

DESCRIPTION

A short talk at Taipei Python User Group gathering on 2012/11/29.

Citation preview

Page 1: Build Python CMS The Plone Way

Build Python CMSThe

PloneWay

胡崇偉 marrmarr.tw @ gmail.com

Fork MeIf You Dare

Page 2: Build Python CMS The Plone Way

Common Ways to Have Your Sites

1. Building Them with Frameworks2. Building Them with CMSes

You are here Your Website here

Page 3: Build Python CMS The Plone Way

Please Guide Me …

Page 4: Build Python CMS The Plone Way

Plone = Python based CMSCMS = Contents in Database

Added/Edited by User/Group Managed via Workflow Searchable with Index/Catalog

Forms in Database

or simply…

Page 5: Build Python CMS The Plone Way

Installation Options

1. Unified Installer2. /usr/bin/python3. VirtualEnv

Page 6: Build Python CMS The Plone Way

Quality Assurance

Page 7: Build Python CMS The Plone Way

Solid Core• Proven Migration Path•Good approximation of

Security Track Records of All Stack Components

http://plone.org/products/plone/security/overview

Page 8: Build Python CMS The Plone Way

Undo, Transaction, Versioning

Python’s dynamic nature allows developers to quickly develop applications, avoiding the compile cycle and static typing declarations required by other languages. The ZODB offers a similar benefit: developers who use the ZODB can store their objects transparently without any cumbersome mapping of objets to relational database tables.

How Plone Database Interacts with Applications

Page 9: Build Python CMS The Plone Way

Welcome to Plone College

•Announcement•About Us•People

http://mysite.ploud.com/

Page 10: Build Python CMS The Plone Way

Default Content TypesPageNews ItemEventImageFileLink

FolderCollection• Announcement

• About Us• People

Page 11: Build Python CMS The Plone Way

Editing a Page

• Title• Summary• Body Text

Page 12: Build Python CMS The Plone Way

Sharing Setting

•Can Add•Can Edit•Can Review•Can View

Page 13: Build Python CMS The Plone Way

One Folder Different Display

Page 14: Build Python CMS The Plone Way

News Item Listing #1

Page 15: Build Python CMS The Plone Way

News Item Listing #2

Page 16: Build Python CMS The Plone Way

Content Rule

Page 17: Build Python CMS The Plone Way

More ThanOut-Of-The-Box Functionalities

Needed?With a Little Help from My Friends

Page 18: Build Python CMS The Plone Way

Python Building Blocks

Python Packages are distributed as Eggs

Python Package Indexhttp://pypi.python.org/

Example:easy_install docutils

pip docutils

Page 19: Build Python CMS The Plone Way

How Plone Add-ons Workzc.buildout helps to install addons

Page 20: Build Python CMS The Plone Way

Extend Plone with Add-ons

Plone Addon (Product) =~ Python Package (Egg)

Page 21: Build Python CMS The Plone Way

Form = Content Type

Forms are Common in CMS

Page 22: Build Python CMS The Plone Way

Form = CMS Core

Content Type = Schema = Fields + Widgets

Page 23: Build Python CMS The Plone Way

ArcheTypes Content Framework

ATNewsItemSchema = \ ATCTSchema.copy() + Schema(( TextField('text‘, required = False, widget = RichWidget(label=‘Body Text’) ), ImageField(‘image‘, required = False, widget = ImageWidget(label=‘Lead Image’) ),

Page 24: Build Python CMS The Plone Way

From Archetypes To Dexterity

Improved Content Type Building Framework

Page 25: Build Python CMS The Plone Way

Fields and Widgets

Page 26: Build Python CMS The Plone Way

Dexterity Behaviors

Reusable components that can beenabled on a per-type basis

through enumeration in the FTI.

Page 27: Build Python CMS The Plone Way

Dexterity Behaviors Example

Reusable components that can beenabled on a per-type basis

through enumeration in the FTI.

Page 28: Build Python CMS The Plone Way

Deco is Coming

Page 29: Build Python CMS The Plone Way

Diazo : Theming Engine

Page 30: Build Python CMS The Plone Way

Diazo Concept

http://www.diazo.org/

Page 31: Build Python CMS The Plone Way

Diazo In Action

http://screenr.com/snt8

Page 32: Build Python CMS The Plone Way

Plone API1. Portal2. Content

3. Users4. Groups

from plone import api

portal = api.portal.get()catalog =

api.portal.get_tool(name="portal_catalog")user = api.user.create(email='[email protected]')

Page 33: Build Python CMS The Plone Way

SQL Integration1. Database Adapter + Z SQL Method• mysqldbda / psycopg

2. ORM (SQLAlchemy)• ContentMirror

3. Pickle• RelStorage

Page 34: Build Python CMS The Plone Way

Considerations

1. Product vs Framework2. ZODB: a Double-edged Knife3. Positioned as Enterprise Grade4. Resource Availability5. Integration Issues

Page 35: Build Python CMS The Plone Way

Create a website using the Plone CMS in less than 10 seconds. Free with basic features or pay to get more features and storage.

Try It – http://Ploud.com

Page 36: Build Python CMS The Plone Way

Thank You