Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Python intro for Plone users


Published on

A quick introduction to the power of Python for prospective users of the Plone CMS.

Published in: Technology
  • Be the first to comment

Python intro for Plone users

  1. 1. Plone is great,Python is too! Carlos de la Guardia
  2. 2. You just chose Plone as a CMSCongratulations. You might not realize it yet, but in addition to picking a great CMS, you have implicitly selected a programming language: Python.
  3. 3. Make it an explicit choice Unless you plan to only use Plones out of the box functionality and third party products, you will need Python at some point. Its better to dive in and get to know the language, because Plone can be used to create fantastic content based applications that extend the platform, but you need Python for that. You can of course depend on one of the many Plone companies around (we thank you for your business), but if you are the kind of organization that has its own developers, it easy to introduce them to Python.
  4. 4. About Python”The Python paradox: if a company chooses to write its software ina comparatively esoteric language, theyll be able to hire betterprogrammers, because theyll attract only those who cared enoughto learn it.” Paul Graham Python is powerful... and fast Python plays well with others Python runs everywhere Python is friendly... and easy to learn Python is Open Python developers care about Python
  5. 5. Python the language very clear, readable syntax strong introspection capabilities intuitive object orientation natural expression of procedural code full modularity, supporting hierarchical packages exception-based error handling very high level dynamic data types extensive standard libraries and third party modules for virtually every task extensions and modules easily written in C, C++ (or Java for Jython, or .NET languages for IronPython) embeddable within applications as a scripting interface
  6. 6. Python the community Global, diverse community Regional conferences all over the world The Python Foundation oversees the advancement of the language and supports community groups and efforts The community is friendly and open Many Plone developers are very involved with the language
  7. 7. Python package index Repository of software for the Python programming language 17,489 packages and counting Packages can be installed from the command line directly from this repository Plone uses it to get third party products (and Plones components as well)
  8. 8. The Zen of Pythoncguardia@hal9001:~/work/eye$ pythonPython 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)[GCC 4.4.5] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import thisThe Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better than dense.Readability counts.Special cases arent special enough to break the rules.Although practicality beats purity.Errors should never pass silently.Unless explicitly silenced.In the face of ambiguity, refuse the temptation to guess.There should be one-- and preferably only one --obvious way to do it.Although that way may not be obvious at first unless youre Dutch.Now is better than never.Although never is often better than *right* now.If the implementation is hard to explain, its a bad idea.If the implementation is easy to explain, it may be a good idea.Namespaces are one honking great idea -- lets do more of those!
  9. 9. With Python you can extend Plone You can create new content types You can create portlets You can define special views for your content You can personalize existing views You can manipulate your sites content programatically Basically, you can make Plone do your bidding But...
  10. 10. Youll also know when NOT to use Plone As we saw, Python offers tons of packages and tools in many different areas Python is specially strong in web development Plone is a great CMS, but its not meant to be used for all your website needs Trust me, you dont want to meet FrankenPlone
  11. 11. Warning signs If you are thinking ”we need something like Plone, but without this and this and this...” Or ”we could use Plone, except well have to add this and this and this” Resist the temptation. Heres a rule of thumb: if yours is not a content application or if Plones functionality would get in the way of what you want to do, you might be better of with something else.
  12. 12. Combining Plone with other Python tools Need reporting? Plone is not well suited for many writes to the database. But with Python and SQLAlchemy you can create a reporting app and make Plone push data there. Need to share data? You can have Plone return JSON data and another Python app can use it. Plone can also easily get data from other applications in a variety of formats. With Python, many times this means a library import and a few lines of code. Need to analyze your Plone database? Why not write a pure Python app that connects to a copy of your ZODB directly?
  13. 13. Python for Web Development Sometimes Plone may not be the right tool for the job. Need a financial system, an accounting package or a web store? There are many Python frameworks that can help you create web applications. Pyramid (personal favorite), Flask, Django are all great choices. Using Python for all gives you advantages like having common library code specific for your organization and allowing team members to work on the different web applications
  14. 14. In Conclusion Python is a great language, give it a chance Consider using it for more than your Plone site Know when to extend Plone and when to go with somethimng else. Statistics show that youll have happier developers Some developers end up not working with Plone when they change jobs to somewhere where its not used. They never leave Python, though.