Project description

w20e.pycms==========

Only fools and nerds create their own CMS nowadays. Hurray! Anyway, sohere it is, w20e.pycms. Using the Pyramid framework as its base,building on top of good old Zope (and some Plone) concepts. The CMS iscreated using these main concepts:

* ZODB as database* ZCML as configuration/glue language* small core* optional components (like search, catalog, sharing); just include what you like

The CMS is a framework, not an out of the box app. What you'll need todo is create your own Pyramid app, using the CMS as base. We've triedto make this as easy as possible: use w20e.pycms.sitemaker (to befound on github or pypi) to obtain a paster template for your app. Runpaster to create your app, and there you go...

Why?----

w20e.pycms is Yet Another CMS, but without using the acronym. Why,for the flying spaghetti monsters sake another CMS? Well, you know howit goes. You use Plone for some years, find out that when yourfavourite tool is a hammer, all problems have a rather strong tendencytowards nailishness... Then Pyramid comes along, giving you the bestof Plone (ZODB, Zope Component Architecture, ZCML, Chameleon, etc.)for creating lightweight apps. Then you need a Page withWYSIWYG... then you need search... sharing. Then you wake up with abasic CMS in your hands. May as well share it so you can decide foryourself whether it is worth your while. I mean, you dont __have__ touse it!

Anyway, read on if you like...

For whom..?-----------

w20e.pycms is not for the faint of heart, nor for people that cannotread Python code, hate programming, think that the use of XML forconfiguration is sooo 1990, are convinced that Windows 95 was the bestOS ever or would preferrably use a rocket launcher to deal with verminin the kitchen. It _is_ on the other hand, for those that rankfuckit.js among the best JS libraries ever, enjoy Terry Pratchett,love buildout en ZCML and think that beer is so much more that just abreakfast drink.

Features--------

Our little CMS gives you a framework to build your sites upon, ifyou're not targeting the enterprise market. If you do, be gone (to theplone.org site)!

- Most likely you'll want to override the 'content' macro, that is called to display a page. To do this, make your own pt file, make that extend 'main.macros['master'], and let it fill the 'body' slot:

and add to your configure.zcml (always assuming you called your macromain.pt):

<pycms:macro name="body" ptfile="yourpackage:templates/main.pt" />

Using the CMS: core concepts----------------------------

The core CMS consists solely of pages. Pages are just things withtext. Nothing serious. You may want to create your own content types,actions, etc. Luckily that's not hard to do. Best way is to look atexisting code... Anyway, some examples here:

Actions-------

You can register actions with your content. The currently used setupmainly uses 'perspectives' or ways to look at your content. In themanagement interface these are rendered as 'tabs'. Actions areconfigured using zcml. Use the action statment as follows:

You may want to use w20e.forms (read: should) for your model. You caneither create an xml form that describes your model, or if you insiston doing things more Pythonic, create your formprogrammatically. Checkout out w20e.forms for details.

A simple model looks like this:

from w20e.pycms.models.base import BaseContent

class SomethingSimple(BaseContent):

""" Well, actually it's more like an 'object'... """

def __init__(self, content_id, data=None):

BaseContent.__init__(self, content_id, data)

def base_id(self):

return self.__data__['title']

@property def title(self):

return self.__data__['title']

You can configure how your form for editing and adding isfound. Default is that PyCMS looks for a file in <your packagehome>/forms/<content type>.xml, so in this case:

<package home>/forms/somethingsimple.xml

If you want something completely different, configure an adapter for yourcontent type that provides a form factory:

And make sure it actually implements IFormFactory and can create aform (w20e.forms.interfaces.IForm).

Natures-------

An alternative for defining content types is defining 'natures'. Let'sface it: what is so special about an event? It is really just a pagething with a start- and end date and a location, isn't it? And whatabout news? Isn't that not very much like a page too? If you agree,read on...

A page can be not only a page, but it can also be news-ish, orevent-ish. That is it's nature. You can register natures like so:

Sharing anyone?---------------Would you like search enabled for your site?

Add this to your configure.zcml:

<include package="w20e.pycms_sharing"/>

and this to your setup dependencies (don't forget to run buildout):

w20e.pycms_sharing

Settings--------

pycms.acl.force_new = True|False Force new version of ACL. All your security data will be lostpycms.catalog.force_new = True|False Force new version of catalog. All your entries will be lost, but you can just run reindex-catalog and all is well again...pycms.admin_user = <user>:<pwd> Admin user and password, like so: pycms.admin_user = admin:pipopycms.admin_secret = <somesecret> This secret may be used as URL parameter to obtain admin permission Use it wisely!pycms.minify_css = True|False Minify CSS. Defaults to Falsepycms.minify_js = True|False Minify JS. Defaults to Falsepycms.logged_in_redirect = <url>pycms.rootclass = <full dotted classname> Defaults to w20e.pycms.models.site.Sitepycms.roottitle = <string> Defaults to "Welcome"pycms.from_addr Send email as ...pycms.bcc_addr Send also to bccpycms.after_add_redirect Where to go after successfull addpycms.cancel_add_redirect Where to go after cancelled addpycms.after_del_redirect Where to go after deletepycms.tempregister.timout = <int> minimal amount of seconds before a temporary object might be removed

1.1.1a------* initially created objects will have a temporary state, until theyhave been completed* add_macros now within base view class, so it's easier to override* validation.js fixed for bootstrap class names

1.0.2a======* Finally we have a serious (?) licence. Also updated some metadata.