Upload
tsungwei-hu
View
1.950
Download
3
Tags:
Embed Size (px)
DESCRIPTION
A short talk at Taipei Python User Group gathering on 2012/11/29.
Citation preview
Build Python CMSThe
PloneWay
胡崇偉 marrmarr.tw @ gmail.com
Fork MeIf You Dare
Common Ways to Have Your Sites
1. Building Them with Frameworks2. Building Them with CMSes
You are here Your Website here
Please Guide Me …
Plone = Python based CMSCMS = Contents in Database
Added/Edited by User/Group Managed via Workflow Searchable with Index/Catalog
Forms in Database
or simply…
Installation Options
1. Unified Installer2. /usr/bin/python3. VirtualEnv
Quality Assurance
Solid Core• Proven Migration Path•Good approximation of
Security Track Records of All Stack Components
http://plone.org/products/plone/security/overview
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
Welcome to Plone College
•Announcement•About Us•People
http://mysite.ploud.com/
Default Content TypesPageNews ItemEventImageFileLink
FolderCollection• Announcement
• About Us• People
Editing a Page
• Title• Summary• Body Text
Sharing Setting
•Can Add•Can Edit•Can Review•Can View
One Folder Different Display
News Item Listing #1
News Item Listing #2
Content Rule
More ThanOut-Of-The-Box Functionalities
Needed?With a Little Help from My Friends
Python Building Blocks
Python Packages are distributed as Eggs
Python Package Indexhttp://pypi.python.org/
Example:easy_install docutils
pip docutils
How Plone Add-ons Workzc.buildout helps to install addons
Extend Plone with Add-ons
Plone Addon (Product) =~ Python Package (Egg)
Form = Content Type
Forms are Common in CMS
Form = CMS Core
Content Type = Schema = Fields + Widgets
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’) ),
From Archetypes To Dexterity
Improved Content Type Building Framework
Fields and Widgets
Dexterity Behaviors
Reusable components that can beenabled on a per-type basis
through enumeration in the FTI.
Dexterity Behaviors Example
Reusable components that can beenabled on a per-type basis
through enumeration in the FTI.
Deco is Coming
Diazo : Theming Engine
Diazo Concept
http://www.diazo.org/
Diazo In Action
http://screenr.com/snt8
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]')
SQL Integration1. Database Adapter + Z SQL Method• mysqldbda / psycopg
2. ORM (SQLAlchemy)• ContentMirror
3. Pickle• RelStorage
Considerations
1. Product vs Framework2. ZODB: a Double-edged Knife3. Positioned as Enterprise Grade4. Resource Availability5. Integration Issues
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
Thank You