23 Oct 2011

feedPlanet TurboGears

Cliff Wells: FreeSWITCH on Scientific Linux 6.1

SL 6.1 (and I assume RHEL and CentOS 6.1 as well) has introduced an issue for building and running FreeSWITCH. Apparently a lot of stuff now relies on dynamically linking to libnss3. libnss3, in turn, depends on libnspr4.so, which depends on libplds4.so. Seemingly, this should not be an issue (stuff depends on chained shared objects all over the place), but somehow it is.

What happens is first you can't compile FreeSWITCH. You get complaints about unresolved symbols in /usr/lib64/libnss3.so. The solution is to run the following commands:

yum install nspr-devel
env LIBS="-lnss3 -lnspr4 -lplds4" ./configure
make && make install

This will get you a compiled version of FreeSWITCH. However, when you actually run it, you'll find that several modules won't load at runtime (including the ODBC driver, should you happen to be using it). The solution for this is similar. Assuming you are using an init script to launch FreeSWITCH, you can add the following line to the top of /etc/init.d/freeswitch:

export LD_PRELOAD="/usr/lib64/libnss3.so /usr/lib64/libnspr4.so /usr/lib64/libplds4.so"

Voila. Everything works. Hopefully the FreeSWITCH devs get on RHEL6 support soon, but meanwhile this should get you by.

23 Oct 2011 3:27pm GMT

18 Oct 2011

feedPlanet TurboGears

Michael Pedersen: Request For Ideas for Hiring Pond

So, a favor to ask of people: I'm working on a web application to help people manage their resumes. As I've gotten further in, I've realized I don't have an actual todo list for it. So, since I'm making this to be used by others, I'll ask everybody here:

What would you want to see? Currently, I've added enough code to allow the program to output something very close to my online resume ( http://www.icelus.org/ ). Next up, I have the following features on my todo list already:

What else would you all want to see in order to make you want to use this?

18 Oct 2011 8:44pm GMT

04 Oct 2011

feedPlanet TurboGears

Alessandro Molina: TurboGears2 Performance Improvements

As recently some effort has been involved in improving the performances of TurboGears2, I was curious to see how much things improved. As usually, the test isn't really reliable in any way and was just for fun.

All the graphs report the request/sec the application has been able to perform on my computer with only 1 concurrent client. So higher is better.

Here is the comparison between TG2.0 and TG2dev (will be 2.1.4)

I also compared various setups with different template engines on TG2dev

The comparison happened on an application similar to the quickstarted one.
Actually as there is no database involved in this application the template engine impacts a lot and so was a good benchmark for the template engines themselves.

04 Oct 2011 3:35pm GMT

03 Oct 2011

feedPlanet TurboGears

Ralph Bean: threebean

It's done. An over-engineered WSGI middleware component that adds a velociraptor to every page served. Fact: Every WSGI app is better with a raptor.

It's called raptorizemw (pronounced "awesome") and the only way to use it is in production.

03 Oct 2011 8:35pm GMT

28 Sep 2011

feedPlanet TurboGears

Michael Pedersen: Announcement: TurboGears2 2.1.3 Released!

We are pleased to announce the latest release of TurboGears, 2.1.3!

This release adds support for the Mongo object database and the Ming ORM for it, in addition to bringing in some small bugfixes. The full changelog is below

The number of changes is, admittedly, small, but don't underestimate the importance: NoSQL databases are an important tool for the web, and adding the support for Mongo brings TurboGears into the group of frameworks that not only supports it, but supports it well.

We're already looking forward to expanding support and closing even more issues for 2.1.4, so we'll see you next month for that release!

* Added support for MongoDB into the quickstart template
* Added lurl (lazy_url) support for late evaluation
* Adding tests module back into source distribution. Solves ticket 115
* Template caching is now manageable by TG applications
* Clean up output for flash() in default quickstart
* Performance enhancements
* Fixed missing dependencies in TG quickstart on Python 2.4

28 Sep 2011 9:22pm GMT

24 Sep 2011

feedPlanet TurboGears

Ralph Bean: threebean

I wrote an app that scrapes foreclosure data from my county of residence and plots it six ways from Sunday in a TurboGears2.1 app. You can find it at http://monroe-threebean.rhcloud.com/, hosted on redhat's openshift cloud.

It's used by activists with Take Back the Land, Rochester and my local branch of the ISO to find upcoming evictions before they happen and organize the neighborhoods to stop the shuttering of homes. Get a hundred people at the door of the house before the cops come, and no-one is getting evicted (we've had some successes).

We're living in some absurd times where banks got bailed out by the trillions yet still get to collect on our student debt and mortgages. Most of us are being ruined. If you're not, then your neighbor is.

If you're in Boston, check out Vida Urbana

or if you're in Chicago, check out the Chicago Anti-Eviction Campaign. Anywhere you go, check out the ISO.

Fork my code, port it to your home town, and start organizing!

24 Sep 2011 4:01pm GMT

18 Sep 2011

feedPlanet TurboGears

Michael Pedersen: TurboGears and Ming/Mongo

I know that my followers are few, and my posts are too infrequent. I'm looking for ways to change my posting frequency.

But, even still, I have an important request: TurboGears 2.1.3 is getting ready to be released. We're adding Ming/Mongo support in this release. Anybody who can, please review the changes (core, devtools, and docs), run tests, etc. We need to make sure we've got this as correct as possible for everybody.

Thank you for your time!

18 Sep 2011 9:29pm GMT

12 Sep 2011

feedPlanet TurboGears

Curia: The long overdue “Shootout” update

It's been several months since I've had a chance to update The Great Web Framework Shootout, but this weekend I decided that it was time to dig in and freshen things up a bit.

Not only have most of the frameworks seen new releases since the last revision, but I finally decided to move all of the tests over to Amazon's "release" version of the Ubuntu LTS AMI.

Below is a quick summary of what's new in this revision:

Circle me on Google+ to keep track of further updates, and feel free to contact me there with any questions or comments.

12 Sep 2011 7:08pm GMT

24 Aug 2011

feedPlanet TurboGears

Michael Pedersen: Announcement: TurboGears2 2.1.2 Released!

We are pleased to announce the latest release of TurboGears, 2.1.2!

This is a maintenance/bugfix release for the 2.1 series which also adds some new features. The full changelog is below.

Highlights for this release include the beginnings of our new book "TurboGears2 Web Applications: Batteries Included", Python 2.7 support, improved Jinja2 support, and quite a few bug fixes.
You can see the book as it stands right now at http://www.turbogears.org/book/ . We're working towards getting more details and more of the older documentation updated to go into the book.

We took longer to reach this release milestone than we had planned, but Real Life(tm) takes its toll on everybody during the summer months, it seems.

Even still, I can speak for the whole team when I say that we look forward to continuing to serve the community with quality code, and we look forward to your continued support!

Full Change Log Here:

For TG2.x Core:

For TG2.x Devtools:

For TG2.x Docs:

24 Aug 2011 8:58pm GMT

19 Jul 2011

feedPlanet TurboGears

Ralph Bean: You should be all gravy.

Often, you will need to authenticate against ldap in your webapp. Here's how to make that happen in a freshly quickstarted TurboGears 2.1 app.

Setting up your environment

mkvirtualenv --no-site-packages repoze-ldap-app
pip install tg.devtools
paster quickstart   # call the app repoze-ldap-app, yes to mako and auth
cd repoze-ldap-app
python setup.py develop
pip install genshi  # This is a workaround.
paster setup-app development.ini
paster serve development.ini  # To test if the basic app works.

Point your browser at http://localhost:8080 just to make sure everything is cool.

Setting up repoze.who.plugins.ldap

Add the following line to the install_requires list in setup.py:


Run python setup.py develop to install the newly listed repoze plugin.

Add the following four lines to development.ini which reference an as yet unwritten secondary configuration file. Place them just above the sqlalchemy.url=... lines:

# Repoze.who stuff
who.config_file = %(here)s/who.ini
who.log_level = INFO
who.log_stream = stdout

Create a new file who.ini with the following contents:

# This file is adapted from:
# http://threebean.wordpress.com/2011/07/19/using-repoze-who-plugins-ldap-in-a-turbogears-2-1-app/
# which has been adapted from:
# http://static.repoze.org/whodocs/#middleware-configuration-via-config-file
# which has been adapted from:
# http://code.gustavonarea.net/repoze.who.plugins.ldap/Using.html

use = repoze.who.plugins.friendlyform:FriendlyFormPlugin
login_form_url= /login
login_handler_path = /login_handler
logout_handler_path = /logout_handler
rememberer_name = auth_tkt
post_login_url = /post_login
post_logout_url = /post_logout

use = repoze.who.plugins.auth_tkt:make_plugin
secret = omg_this_is_so_secret_lololololol_2938485#butts

# Here I use my own ldap_auth, since by default ldap allows affirmative
# authentication with *no password specified*.  That is lame; I override it.
use = repozeldapapp.lib.auth:ReconnectingAuthenticatorPlugin

# This is the URI of wherever you want to connect to.  I work at RIT.
ldap_connection = ldap://ldap.rit.edu

# This is the base of the 'distinguished names' (DNs) of persons in your
# particular LDAP instance.  It will vary from server to server.
base_dn = ou=People,dc=rit,dc=edu

# I also do some overriding for more security in how I get attributes for
# users.
use = repozeldapapp.lib.auth:ReconnectingLDAPAttrsPlugin
ldap_connection = ldap://ldap.rit.edu

request_classifier = repoze.who.classifiers:default_request_classifier
challenge_decider = repoze.who.classifiers:default_challenge_decider

plugins =

plugins =

plugins =

plugins =

Create another new file repozeldapapp/lib/auth.py with the following contents:

from repoze.who.plugins.ldap import (
    LDAPAttributesPlugin, LDAPAuthenticatorPlugin
import ldap

class URISaver(object):
    """ Saves the ldap_connection str given to repoze authn and authz """
    def __init__(self, *args, **kw):
        self.uri = kw['ldap_connection']
        super(URISaver, self).__init__(*args, **kw)

class ReconnectingLDAPAttrsPlugin(LDAPAttributesPlugin, URISaver):
    """ Gets attributes from LDAP.  Refreshes connection if stale. """

    def add_metadata(self, environ, identity):
        """ Add ldap attributes to the `identity` entry. """

            return super(ReconnectingLDAPAttrsPlugin, self).add_metadata(
                environ, identity)
        except Exception, e:
            print "FAILED TO CONNECT TO LDAP 1 : " + str(e)
            print "Retrying..."
            self.ldap_connection = ldap.initialize(self.uri)
            return super(ReconnectingLDAPAttrsPlugin, self).add_metadata(
                environ, identity)

class ReconnectingAuthenticatorPlugin(LDAPAuthenticatorPlugin, URISaver):
    """ Authenticates against LDAP.

    - Refreshes connection if stale.
    - Denies anonymously-authenticated users


    def authenticate(self, environ, identity):
        """ Extending the repoze.who.plugins.ldap plugin to make it much
        more secure. """

        res = None

            # This is unbelievable.  Without this, ldap will
            #   let you bind anonymously
            if not identity.get('password', None):
                return None
                dn = self._get_dn(environ, identity)
            except (KeyError, TypeError, ValueError):
                return None

            res = super(ReconnectingAuthenticatorPlugin, self).authenticate(
                environ, identity)

            # Sanity check here (for the same reason as the above check)
            if "dn:%s" % dn != self.ldap_connection.whoami_s():
                return None

        except ldap.LDAPError, e:
            print "FAILED TO CONNECT TO LDAP 2 : " + str(e)
            print "Retrying..."
            self.ldap_connection = ldap.initialize(self.uri)

        return res

Finally, do two things to repozeldapapp/config/middleware.py.

Edit it and at the top of the file add:

from repoze.who.config import make_middleware_with_config

Add the following inside the make_app(...) function, just below the comment line about Wrap your base TurboGears 2…, like so:

    # Wrap your base TurboGears 2 application with custom middleware here
    app = make_middleware_with_config(
        app, global_conf,

Give it a test

Restart the paster server and reload http://localhost:8080. Try logging in as a user in your ldap instance and you should be all gravy.

You should be all gravy.

You should be all gravy.

19 Jul 2011 4:24pm GMT

15 Jul 2011

feedPlanet TurboGears

Mengu Kagan: Deploying TurboGears 2.1 Application With Nginx And uWSGI

I have developed a TurboGears 2.1 application and I was asked to deploy it today. I was planning to use Apache and mod_wsgi however on CentOS 5.6 both are painful. I was getting some errors that I really did not want to deal with so I have decided to use nginx and uWSGI. Great combination I believe. The thing is I had to deploy this application to 3 web servers as we are using a load balancer so I have created a deployment script to use on all 3 web servers but surely I won't let you figure out how to deploy from this script.

Let's cut the chase and get to the point.

15 Jul 2011 3:03am GMT

12 Jul 2011

feedPlanet TurboGears

Christpher Arndt: ELKA PM 13 MIDI Basspedal (Version B)

Beschreibung, Anleitung und Kurzreview Das ELKA EM 13 MIDI Basspedal ist ein reiner MIDI-Controller ohne Klangerzeugung und dafür ausgelegt, mit den Füßen gespielt zu werden, um beide Hände zum Gitarre- oder Keyboardspielen oder Sonstigem freizuhaben. Die Pedale umfassen eine Oktave, von C bis C, ansonsten hat das Gerät keinerlei Klangsteuerungsmöglichkeiten und auch nur einen zusätzlichen [...]

12 Jul 2011 1:23pm GMT

Curia: Google+: It’s a bigger deal than Facebook, but not like you think

I've been on Google+ since week 1 and while the initial mood has been overwhelmingly positive, I couldn't help but notice the content of my stream becoming a bit skewed over the past few days as Google began opening it up more and more to "the laypeople." Google was wise to restrict G+'s initial membership base to the tech-savvy, because we're already on to Google about where it's going with this thing; but now that the rest of the world is jumping onboard there seems to be a bit of confusion about what it's good for.

In response to this, I thought I'd share a few of my own thoughts on G+, and why I believe it is a valuable and needed addition the online social ecosystem:

1. It's not Facebook, and it's not Twitter-it's a bit of both, and the key is Circles.

What Twitter does best is giving busy professionals, celebrities, and business entities an outlet to interact publicly with their audience on a pseudo-personal level in 140 characters or less. What Facebook does best is giving people an outlet to interact somewhat privately with people they trust on as personal of a level as they like. For many, the separation between Twitter vs. Facebook mirrors their own separation of business vs. personal. For example: A picture of your 2-year old squeezing the cat is more likely to wind up posted to a limited audience on Facebook than publicly shared on Twitter, while a quick blurb updating anyone interested on a recent professional achievement often needs a more public forum such as Twitter to gain the visibility you want it to have. Even in each of their post boxes you can see the difference in what's expected to be shared: Twitter asks "What's happening?" expecting you to want the whole world to know, while Facebook asks "What's on your mind?" which is quite a bit more personal.

What Google+ gives you is both (and much more), through the power of a brilliant feature called Circles. No longer is it a question of public vs. private, but rather the much more honest and straightforward "Who do you want to share this with?" Through Circles, you now have complete control over who will and who wont see the content you are about to share. You may only want "close friends" to see how crazy that party was last night, while "friends" can be given access to pictures of your recent vacation to Hawaii, and the whole world can have access to that presentation you did last week that received a standing ovation.

(Note: Yes I am aware that Facebook offers something similar to Circles, but its integration is clumsy and inconvenient in comparison.)

2. For now, it may only be relevant to those who manage multiple online identities.

Sure, there are plenty of people who use Twitter and Facebook as practically the same outlet, and if you're one of those then Google+ is probably going to be little more than a redundant nuisance-one more social network to have to keep track of.

Or perhaps you're the Facebook-only or Twitter-only type and simply don't see the point in jumping ship or picking up another service. I applaud you for your loyalty, but in this day and age resistance to "the big G" is futile. Which leads me to my final thought…

3. If you can look to the horizon, it might just be bigger than anything we've seen yet!

The real thing to keep in mind in these early days is that G+ is just the beginning of Google's plan to bring a social element to many of its products and services. In the coming months, you are probably going to see the google.com ecosystem revolve more and more tightly around G+ to a point where involvement in the + will be unavoidable. They have already somewhat merged Picasa and there are whispers of a full-on integration with Gmail. What else could be coming? Well, just think about all of the services that Google currently offers and simply add a "+" to them: Music+, Calendar+, Maps+, Docs+, Checkout+, etc.-and I'm not even going to take the time here to mention Android and the possible mobile implications!

But what about speculative projects? Well, Google recently sank loads of cash into a little company called Zynga and not too long ago partnered with Rovio to bring Angry Birds to Chrome. Can you imagine playing "Words With Friends+" or "Angry Birds+" online with all your G+ friends?

The future of Google is here folks, and it's as subtle as a +.

12 Jul 2011 1:53am GMT

19 Jun 2011

feedPlanet TurboGears

Alessandro Molina: TurboGears 2.1.1 released!

After a reflection moment caused by the need to think what will follow after the pylons and repoze.bfg merge in pyramid the TurboGears2 team has decide to gather up all its forces and give to TurboGears2 its own independent life.

The first steps have been oriented to improve the framework reliability and brought to life the TurboGears continuous integrations system and a standard project release process.

After a few months of work 2.1.1 has been released and it brings many fixes and improvements, 2.1.2 is under its way and a 2.2 release with major improvements is already planned!

TG2 Core:
* Fixed dependencies for Python 2.4. Now any packages that are
needed are automatically installed.
* Updated package requirements as high as possible.
* Verified nested RestControllers work as expected
* Added/fixed Kajiki support
* Ignore repoze.who_testutil when running nosetests
* Fixed import order for pylons.middleware
* Fixed crash when PYTHONOPTIMIZE is enabled
* Report a warning about ErrorMiddleware is disabled
* Fixed concurrency issues with use_custom_format
* Fixed 404 errors if a controller uses only custom formats
* Verified that user object is available inside of the error controller/template
* Fixed expansion of arguments on before/after calls
* Fixed wrong header response for 405 error
* Fixed WebOb version requirment. Newer version required
* Added test case to check for replace_header when called from WSGIApp
* Fixed issues with Content-Type header appearing multiples times on 204/205 responses
* Removed redundant hasattr checks on override_template
* Improved support for pylons 1.0 strict_c
* Fixed post traceback, now reports to Pylons correctly
* Added test case to check for spurious content type removal on empty content
* Fixed crash when content type header is missing
* Fixed crash when response Content-Type is set to None
* Fixed support for etags. Pylons 1.0 changes slightly, we support the correct version now
* Added dependency_links and setup.cfg allow_hosts: easy_install TurboGears2 now works
* Fixed DecoratedController. should not call super(), 2.6 revealed a problem
* Fixed Genshi output method. Use XHTML if none specified, instead of XML

TG2 Devtools:
* Fixed Python 2.4 compatibility issues. Dependencies are now automatically specified
* Updated package version requirements as high as possible
* Fixed about.html instructions about where the logo is found
* Set "zip_safe=False" by default in the templates now
* Tests fixed, now pass
* Added support for sqlalchemy-migrate
* Added option to choose config file
* Added archive_tw_resources command for projects
* Fixed deprecated redirect calls
* Set Genshi templating method by default to XHTML
* Adding dependency_links: easy_install tg.devtools now works

19 Jun 2011 8:59am GMT

15 Jun 2011

feedPlanet TurboGears

Michael Pedersen: Announcement: TurboGears 2.1.1 Released!

We are pleased to announce the latest release of TurboGears, 2.1.1!

This is a maintenance/bugfix release for the 2.1 series. The full changelog is below.

This release has been a long time in the making, and I would like to take a few minutes to thank the people who made it happen.

Mark Ramm, Chris Perkins, and Kevin Dangoor, for supporting me in beginning this whole process back in January.

Alessandro Molina, Christoph Zwerschke, and Diez Roggisch, for contributing much of their precious free time to writing code, making suggestions, and keeping me on track.

Florent Aide and Jon Schemoul, for providing us with a server and tgext.pages to make the site work.

And to everybody in the community that I did not name: Without you, I don't think I would have kept myself working. The results are here, and they belong to you as much as any of the people I named above.

Thank you, everybody. Your support and help mean a great deal to me. I only hope I've lived up to some of your expectations.

I can speak for the whole team when I say that we look forward to continuing to serve the community with quality code, and we look forward to your continued support!

And I know I can say it most strongly for myself. We're back on the move. And I'm liking the results.

Full Change Log Here:

TG2 Core:

TG2 Devtools:

TG2 Docs:

15 Jun 2011 9:21pm GMT

04 Jun 2011

feedPlanet TurboGears

Michael Pedersen: Announcing TurboGears 2.0.4

We are pleased to announce the latest release in the 2.0 series, TurboGears 2.0.4.

This is a maintenance/bugfix release for the 2.0 series. The full changelog is below.

Note that, unless security issues are found, this will be the final release of the 2.0.x line. As 2.1 is fully backwards compatible, and release of 2.1.1 is imminent, we strongly encourage everybody to upgrade as soon as possible.

We look forward to continuing to serve the community with quality code, and we look forward to your continued support!

The following changes were added for 2.0.4:

04 Jun 2011 9:55pm GMT