You are here: Home Blog archive 2013 April

April

Sub-archives

Apr 10, 2013

A Landscape of Python Web Development

by Chris Crownhart — last modified Apr 10, 2013 10:55 PM

Last week we had our kickoff meeting of the new Python Web Development meetup in Fort Collins, Colorado. We had 8 folks at the meeting and had great discussions about a variety of Python products and ideas for future meetings.

In preparation for our kickoff meeting of the new Python Web Development meetup, I started putting together what I called "A Landscape of Python Web Development".  It started with a few of the obvious tools and products that we use at Core Software Group, like Zope/Plone, Django, and boto and suds.

From there, it started becoming obvious that I needed to break down the ever-growing list into mutliple categories.

My list of products played out like this:

The Categories

  • Frameworks
  • CMS
  • Deployment/Hosting
  • Page Templates/Forms
  • Databases
  • Testing
  • Tools/Other
  • Static Site Generators

Frameworks

This list of frameworks includes some old timers, and some newer, 'lightweight' frameworks.  The last one listed, itty, was mentioned in one of Raymond Hettinger's pycon videos, and seemed an interesting, super small framework to check out.

  • Zope
  • Pyramid
  • Django
  • Flask
  • Bottle
  • CherryPy
  • web2py
  • itty

CMS

I'm sure I missed some, but these seemed to be the key players that we have come across, and the interwebs seemed to point to.

  • Plone
  • Kotti
  • Django CMS
  • Mezzanine

Deployment/Hosting

The first three are cloud platforms, and the last three are samples of python tools related to deployment.

  • Heroku
  • Google App Engine
  • Elastic Beanstalk
  • boto for EC2
  • fabric
  • buildout

Page Templates/Forms

This list was a late addition, but is now pretty obvious.  You can't do web development without page templates and forms.

  • Zope Page Templates (ZPT)
  • Django Templates
  • jinja2
  • chameleon
  • deform
  • z3c.form
  • WTForms

Databases

While the following are not directly related to web development, they certainly come into play when building applications that require a backend database.

  • sqlalchemy
  • psycopg2
  • pymongo
  • MySQL-python

Testing

Ok, I have to admit that I'm incredibly weak when it comes to writing tests.  But I needed a list of some of the tools out there.

  • unittest
  • doctest
  • coverage
  • selenium
  • funkload

Tools/Other

Wow. This list could go on and on and on.  I grabbed a few tools that we use, plus a few others I came across over the last month.  Hopefully, we can provide some presentations about some of these in future meetups.

  • suds
  • requests
  • twisted
  • mincss
  • xml.dom, lxml, etree
  • virtualenv
  • simplejson
  • PIL/Pillow

Static Site Generators

This list of static site generators almost has nothing to do with the above items, but I couldn't resist putting the list together.  I'm fascinated by the concept of someone willing to write blog entries as text files, which in turn get deployed as static HTML to some server on the web.  What I really want to know is: "How many folks are actually using these kind of tools for production sites?"

Hovercraft/impress.js

Finally, while building my presentation, I came across a Python package called Hovercraft!, written by Lennart Regebro, for generating impress.js presentations from a reStructuredText file.  Awesome.  And so easy to use.  You can download my kickoff.rst file and the generated output for my presentation.

Our discussion at the Python Web Development meetup was interesting, and it turns out that most of categories really start to look like the definition of a "development stack" which I suppose could be used to define a set of tools that someone might use to get started doing Python based web development.

I hope you find some value in this list.  If I missed some completely obvious products, please add a comment and let me know.

Apr 09, 2013

How to enable User Folders in Plone

by Mike Cullerton — last modified Apr 09, 2013 03:22 PM

User Folders are an option in Plone. You can turn them on In the Security settings area of Site Setup (Plone Control Panel). Here's how I enabled User Folders in Plone from within my product.

I needed to enable the User Folders feature of Plone from within my product. My first thought was to use a Generic Setup profile, but the solution was setuphandlers.py.

I inspected the Enable User Folders button on the Security settings page of Site Setup, and saw the attribute was named enable_user_folders. I tried to find a generic setup profile I could edit.

The closest I got was adding enable_user_folders to properties.xml. This turned the attribute on in the ZMI, but not in Site Setup and User Folders were not enabled.

Then I found a reference to

security.enable_user_folders

in a setuphandlers.py file from the Rhaptos git repo.

So, I added these lines to setupVarious in my setuphandlers.py.
from plone.app.controlpanel.security import ISecuritySchema
site = context.getSite()
security = ISecuritySchema(site)
security.enable_user_folders = True

Now, when I install my product, User Folders are enabled automatically.

Note that you need to make sure setupVarious is turned on in configure.zcml.

<genericsetup:importStep
    name="your.package"
    title="your.package special import handlers"
    description=""
    handler="your.package.setuphandlers.setupVarious"
    />

 Hope this helps someone.

 

Apr 08, 2013

How to open SSH links in iTerm 2

by Mike Cullerton — last modified Apr 08, 2013 04:45 PM
Filed Under:

When I switched to iTerm 2, it wouldn't open ssh links for me. Instead, it opened new tabs. I finally solved the problem with a simple configuration change.

I know some of you have this problem. I've seen a few references to it on the net, but no solutions. iTerm 2 won't open ssh links.

I have a pyramid application that uses boto to query ec2 instances and then posts information about the instances--including an ssh link, to a web page on my laptop.

The ssh links open fine in iTerm. I couldn't get them to open in iTerm 2 though. Instead, they just opened new tabs.

I really like using iTerm 2, so to 'solve' the problem, I added the actual ssh shell command for each of the instances as text on the page.

To open an ssh connection to an instance, I simply copy the ssh command, click the link, paste the ssh command into the new terminal tab, and hit return.

Hey, it works.

Every once in a while, when it really bothers me, I try to figure out a real solution.

Today was one of those days.

The solution turned out to be pretty simple.

In the iTerm 2 Preferences, under the Profiles tab, General section, change the Command to Login shell.

Now, when I click on one of the links, it opens correctly in iTerm 2.

I hope it works for you too.

*Note that you must first have iTerm 2 set up to accept ssh connections. Preferences->Profiles->General->URL Schemes

 

 
 
Copyright © 2003-2018 Core Software Group | 303/809-1001 | Fort Collins, Colorado | All rights reserved.