Jon Hadley - Freelance Web Developer

I am a Bristol, UK, based web developer with over 10 years commercial experience.

I use the latest web standards and languages to produce visually appealing, easy to use, database driven websites.

I have particular expertise in: (X)HTML, CSS, Python, Zope 3, Plone & Zope 2, ASP, VBScript, MS SQL, MySQL, Photoshop, SVN, Moblogging & Digital Photography.

See more of my work at my freelance site, www.jon-hadley.com.

Regular blog posts continue below ...

SSL Support in Python Virtualenv

SSL support in Python doesn't always work out the box, especially when using virtualenv.

You'll know you have a problem when you get an error similar to the following:

AttributeError: 'module' object has no attribute 'ssl'


If you are receiving this using your system Python installation, as well as your virtualenv you'll need to follow Patrick Altman's instructions.

However, after completing the above you will find that your system python passes the following quick test:

$ python
>>> import socket
>>> hasattr(socket, "ssl") 
True


But your virtualenv:

/path/to/your/virtualenv/source bin/activate


Fails the same test:

$ python

>>> import socket
>>> hasattr(socket, "ssl") 
False


It seems that virtualenv has problems picking up ssl settings, especially, in my experience, when openssl is installed after virtualenv. Creating fresh virtual environments has no effect.

To get round the problem, try the following:

Via your system python:

$ python

>>> import _ssl
>>> _ssl.__file__


You should get a path similar to (Do not modify anything in this directory): 

/usr/local/lib/python2.5/lib-dynload/_ssl.so


Copy or symlink that to file in your virtualenv python site-packages folder:

cp /usr/local/lib/python2.5/lib-dynload/_ssl.so /path/to/your/virtualenv/lib/python2.5/site-packages/_ssl.so


And it should all work fine now. Test it in your virtualenv via the same command from earlier:

/var/odbody/uat/odbody-uat/source bin/activate


>>> import socket
>>> hasattr(socket, "ssl") 
True


I believe this to be a bug in virtualenv and have reported it as such. Although I'd happily be proved otherwise!

(Many thanks to Marius Gedminas in #zope3-dev for his help with this problem)

UPDATE: Impressively quick update from virtualenv's author Ian Bicking. I haven't had a chance to test it yet.

Paypal UK & Python PayFlow Pro

Paypal has long had, in my opinion, the best client front end. Users don't have to sign in to give payments and even when they do it's a simple process that Just Works (TM).

However, the API and developer documentation, especially on the UK site is a whole different world of pain, which is compounded by confusing and conflicting articles and multiple, differently supported, systems.

I've recently been trying to integrate the Website Payments Pro UK product with a Zope 3 web site (a Python based framework). There are number of serious gotcha's which caused me a number of days of frustration, which I've documented below in the hope it will save someone else some time:

  1. UK Payment accounts cannot use the 'normal' Paypal API, documented throughout the site. Or at least its not supported/suggested. I'm still awaiting official clarification on this, but either way there is no decent UK based support for the API. Updated, see below.
  2. Paypal UK recently bought the Verisign Payflow Pro system and all API access is now through this system.
  3. Frustratingly point 2 invalidates the usefulness of the many existing Paypal API demos, examples and python wrappers, such as Gocept Paypal.
  4. There is a Python wrapper, python-payflowpro but the code contains a number of errors / undocumented variables that caused a number of problems getting it running:
    • In the example the line: CreditCard(acct=5555555555554444, expdate='1212') will not work. If you pass the account number as a string, rather than an int it will work fine (e.g. CreditCard(acct='5555555555554444', expdate='1212') )
    • PARTNER_ID is PayPalUK
    • VENDOR_ID and USERNAME are the same - They are the username you use to login to the Paypal Manager
    • USERNAME is required, despite being optional in the web login form.
    • PASSWORD is the password you use to login to the Paypal Manager
    • Python 2.5 is required for the wrapper (although for little functional reason). Zope 3 is only officially supported on Python 2.4, but you can run Zope 3 with no problems on a Python 2.5 system.
  5. Finally don't forget to add your current IP to 'Allowed IP Addresses' in Paypal Manager


Thanks to Dan Fairs of Fez Consulting for help with a number of these points, including the useful summation:

"Seems that the only thing that's consistent is that everything's different from everything else!"

Update

It seems new Paypal UK accounts have the option of using the Paypal API, as well as the 'traditional Payflow Pro' system.

Paypal UK - This really needs to be made a lot clearer in your documentation and sales literature, it's far too easy to go round in circles trying to work out what works and what doesn't!

Mashed 08 - Team Bob - Special Mention

My brain is a little less frazzled a week on and various other blog posts have reminded me about the Team Bob news-subtitles-on-dylan-music-video hack, which really did make me (and many others) smile, a lot.



BBC Dylan - News 24 Revisited (Full Version) from James Adam on Vimeo.

Mashed 2008

An excellent mash-up again at Alexandra Palace this past weekend.

Front-end development skills were, perhaps predictably for an event based around rapid prototyping, not in demand again, especially my brand of rather flawed Zope3 servers!

However, the whole event was veritable food for the brain, and fired many sparks in my imagination. I made many new contacts and friendships, and caught up with many others. What's more, the fact that transport, food and 'board' were all free, made it unmissable.

2600126597_89fbac9ffb

Lots more pictures at Flickr.

Continue reading "Mashed 2008" »

GTA IV - First thoughts

I've only played it for an hour or so, but here are some initial thoughts on the game half the male population must be playing this week:

  • The stylised - slightly cartoony - graphics are 'interesting'. I'm surprised more hasn't been made of them prior to launch. I think, they are a clever decision - but I'm still getting used to them.
  • Eastern European theme - Good. 'Funny' cousin role - Bad.
  • Cell phone interaction is carried off very well, its quickly become second nature to use.
  • Many other clever interactive interactions with the world (TV, internet etc) make it all the more pervasive and loveable.
  • Facial and body animation is much improved, running someone over makes me wince every time.
  • Still can't drive (see last point). I'm hoping the loose handling is just a reflection of the cheap cars at the lower levels.
  • Much easier to escape from the police. This seems to have come full circle from the first few games, where this was pretty much the point. A 'good thing' i think.
  • Great music - hilarious commentary. The British background to the game really does shine through, despite - or even in some way fed by - the US setting.
  • Loving the depths to which the city has been characterised, but I do wonder if I'll miss the open spaces of its predecessor.
  • Friends and girlfriends acting as go-betweens and needing 'relationship maintenance' seems interesting - hope it doesn't become an annoyance.
  • I haven't had a chance to go on-line yet, but the multiplayer possibilities of the sandbox world genuinely get me excited.
  • In-context sex, violence and swearing on an 18 certificate game, is much less jarring than the alternative. I hope the certificate (and XBOX's various parental controls) go some way to quelling any media out cry (we can but hope!).

From the short play I've had, its definitely the most engaging XBOX 360 game I've played. I'm itching for another go.

New Design

It's been 4 years(!) since the last re-design, so I thought it was time for a spring clean of my blog.

Expect things to change as I fiddle with the defaults further :)

Zope, Python & Django vs PHP

Rick Hurst, a fellow Bristolian freelancer, who's path I always seem to be crossing (in a good way!) has an interesting post about platform migration and choice, not least for the reasons behind his decision to choose PHP.

I've recently been tasked with choosing the language and platform for a new start-up. Whilst I've pretty much settled on *nix for hosting (cost and freedom being the biggest pros), I've been toying with the language decision for a while

Like Rick, I have a fair number of old applications in ASP which I support, and for a split second I considered using it for this too! It's familiar and if it ain't broken, why fix it?

However, I'm currently leaning towards Zope3 or DJango, due mainly to my exposure, via Plone, to Zope and Python over the last few years.

But .... the sheer amount of help and skills available, locally and internationally, for PHP and it's similarities to ASP, keep giving me second thoughts.

Ethical ISP - Gap in the market?

With the recent bad publicity for many UK ISP's such as:

  • ISP's monitoring users activities without permission, via Phorm
  • Virgin Media CEO's recent comments that "This network neutrality thing is a load of bollocks"
  • The ongoing debacle that is 'unlimited' connections with a ... err... limit

It seems to be that there is a gap in the market for a decent, ethical ISP.

Someone like the Co-operative Group seems perfectly placed....

Latest from Twitter:

    follow me on Twitter

    Friends

    My Other Accounts

    Dopplr Facebook Flickr ICQ Last.fm LinkedIn MSN Messenger Skype Twitter
    Blog powered by TypePad
    Member since 07/2003

    Quick Links