Thursday, February 17, 2011

My Django tutorial at PyCon

Working on my tutorial slides for my PyCon class/tutorial/workshop last night I suddenly came to a stark realization.

Out of dozens of slides, only 5 of them are Pinax specific.

o.O

I think this is because the slides are a condensed version of what the best and brightest in the Django and Python community think are good practices and tools. What do I mean?
So what does this mean?

Well, I've been rethinking the mantra "Pinax is Django".  It is hard to say that when users of django-cms and satchmoproject and other frameworks can't use core Pinax components. That said, users of those tools tend to rely on same foundation: Python, Django, virtualenv, and pip and growing ecosphere of Django Packages.

Which leads me to realize that with just 5 slides pertaining to Pinax material in the tutorial, the Pinax Solutions class could be renamed "Django Solutions class with a bit of Pinax".

And this makes a lot of sense. Some of the bits that made Pinax special such as static media handling are now part of Django as of the forthcoming 1.3 release. Lessons learned from Django Uni-Form which grew out of supporting div-based forms in Pinax are helping determine the path of forms work in Django 1.4. Which means that if you are using django-cms or other CMS, django-shop or other e-commerce tools, then you are benefitting from what Pinax has done for the community.

All of this leads to my closing statements about the class/workshop: The class is about Django with a little bit of Pinax tossed in. Having in the past worked with multiple non-Pinax projects, I can assure you that the solutions presented and the workshop itself will be of use to you regardless of if your project is using that framework.

Monday, February 14, 2011

My Pinax Solutions class at Pycon 2011

Heavily inspired by Zed Shaw's Learn Python the Hard Way class I'm changing the lecture style format of the Pinax Solutions class at PyCon 2011 to a more workshop-oriented format.

Which means that the first half of the class we (myself and the peerless Brian Rosner) will spend on material critical for people new to Pinax or old hands who want to see what 0.9 offers. That means setting things up via virtualenv and pip, Pinax specific settings, media handling, template layout, extending core Pinax apps, use of idios to change profiles, openid/openauth, Django Packages to find Pinax approved stuff and more. That will be the foundation and our slides/handouts will be useful as cheat sheets for these critical parts in any Django application.

The second half of the class will be a workshop. We'll spend the next half helping people with their personal projects, and will even have a few stock projects we can toss at people that either already are open source or could be released as open source. We won't write your project for you, but we will provide advice, guidance, and some elbow grease in getting things to work. If someone asks for something that we think the rest of the class could benefit from, we'll show them how to do it on the projector and then everyone benefits.

After the class, I'm free the rest of the day so I'll continue helping people even after the tutorial is officially over. Thursday (March 10th, 2011) after lunch I'll be also available to provide aid and support.  Anyone else can join but those who attended the Pinax Solutions tutorial will get precedence.

During the main body of the conference I'll be attending talks and giving a couple myself so my time to provide aid will likely be completely curtailed.

I will be there at the sprints working on various Pinax and Django projects.

If time permits we'll go over deployment, but I recommend Jacob Kaplan-Moss' Python/Django Deployment Workshop if you want a full treatment of the subject.

Note I: If you've already signed up for the Pinax Solutions tutorial, you should be getting an email from the PyCon tutorial staff shortly.

Note II: If you are new to Python, I recommend that you take any of the basic Python tutorials at PyCon instead of this class.

Saturday, February 12, 2011

How to sell Python panel at Pycon

Do you want to use Python but are you fighting Fear, Uncertainty, and Doubt (FUD) in your organization? Does any of this sound familiar to you?
  • Python is just a scripting language.
  • Python is too new to use in real production environments.
  • Language X has better benchmarks doing obscure math so it is better for web development.
  • Python sounds great but we've already spent so much on this expensive tool that does things badly!
A lot of people want to use Python, but their customer, management, school, government, or organization won't let them. Python is a great tool, but can be challenging to get in the door. This panel will explore how companies and individuals have successfully introduced Python, what tools are available to sell Python, how to fight the good fight, and what pitfalls there are to avoid.

Panel Questions
For this event at Pycon I've got some stock questions ready but I want the community at large to suggest some more.

Speakers
For this panel I choose five speakers from the broad categories of academia, government, commercial organizations, and non-profit who have had a known impact in their organizations:

Academia
C. Titus Brown is an Open source hacker, Artificial Life/Digital Evolution, B.A. Math (Reed), Earthshine research, Ph.D. Developmental Biology and Regulatory genomics (Caltech), Python testing tools, Python Software Foundation member, Assistant Professor (Michigan State U.) - dev bio, genomics, metagenomics, software engineering. 

Note: A lot of my personal understanding on how to do web tests outside of Selenium is thanks to a Pycon tutorial given by Dr. Brown and Grig Gheorghiu back in 2008. 

Government
Chris Shenton is a partner at Koansys LLC, a consulting company whose clients include US Federal Government agencies, Internet startups, and non-profit organizations. He is a free software and UNIX bigot, advocating for the use of both in organizations large and small. He's been involved with the Washington DC area's Python/Zope/Plone user group ZPUGDC for years, and recently was appointed to its board. 

Note: Chris has the dubious honor of introducing me to Python in 2005 and was pivotal in promoting the adoption of Python for use in NASA's Science Mission Directorate. 

Large BusinessThe Vice President of Engineering at Evite/IAC, Dan Mesh is the person credited by other Evite staff with bringing Python to life in that business. 

We used Evite for our just passed LA area hackathon and plan to use it for future events. 

Non-Profit Organizations
Rich Leland is an Application Architect at National Geographic where he uses Python on a daily basis to work on nationalgeographic.com and its ecosystem of web sites. He is also the founder of django-district, a group for Django users in the Washington, DC area. In the past life he worked for Discovery Channel as Designer and Lead Web Developer. 

Small Business
Frank Wiles is President of Revolution Systems, Lawrence, KS. Expert in Internet infrastructure scaling and performance. Primarily focused on Django and PostgreSQL. 

Note: I credit Frank with providing me with a great opportunity to work with an awesome code base but also the encouragement and support to get me through my first year as a freelance consultant.

Monday, January 31, 2011

What I want for Django Facebook connect

For a customer I need to do Facebook authentication on a new Django project. I went to the Django Packages Facebook Authentication Grid and figured I would plug it in, set some keys, and go! Facebook authentication is a common client requirement, and this must have been solved many times over, right?

Unfortunately, most (I'm still going through them) of the listed packages worry me. Security is HARD. Security is DANGEROUS. Since Facebook auth is a common requirement I shouldn't be forced to roll my own authentication or hack through someone else's implementation to get things working.

Yet many of the packages listed in the grid above lack documentation or what exists is outdated. Some of them simply drop errors or seem to intentionally obfuscate them (I won't name anyone YET because I want to give people a chance to correct these issues). Finally, I've yet to find any with any sort of logging to help diagnose possible intrusions or just as a way to see what is happening when you have trouble hooking up things.

I understand that Facebook is a moving target. But on the other hand, shouldn't updates to these things be in place?

So what do I want in a Django app that does Facebook authentication?
  • Documentation that will build on readthedocs.org.
  • Use of the logging module for diagnosis.
  • Sample project with a working example of hitting a dummy app (call it stupid-test-for-pydanny if you like) on Facebook provided by the project manager.
  • Proper packaging on PyPI
In the spirit of things if your project does this I'm willing to try it out and blog about it. I'm also going to sprint on this issue during Saturday's Hackathon at Cartwheel HQ.

Tuesday, January 25, 2011

Los Angeles Open Source Hackathon

I want to announce the launch of our new company which we've named Cartwheel! Besides Python and Django consulting, our plan is to support local Los Angeles small business, teach classes, and host events. And our first event is a Los Angeles Open Source Hackathon on February 5th! Space is limited so RSVP before tickets run out!

Open Source Hackathon at Cartwheel

A hackathon (or sprint if we want to be Pythonic) is where a bunch of developers get together to push various projects forward.

Bring your laptop and work on any open source project that you'd like, as long as it's open source. It can be an existing open source project (e.g. Django, Python) or a new one of your own. Leave the work stuff at work!

Got an existing project? Hackathons are a great place to share ideas and perhaps find additional contributors. Let me know and I'll put it in an additional blog post.

New to open source? A beginning developer? We'll help you get started with open source software development and do our best match you to a project that fits what you want to do.

Some projects that may be worked on:
Please RSVP as soon as possible. The $10 ($11.54 with fee) ticket price covers breakfast, lunch, and dinner. Costs are partially subsidized by Cartwheel. We hope you can join us!

Thursday, January 20, 2011

Why you should go to Pycon

Because you are new to Python
If you want to get better at Python then Pycon is one of the better avenues to learn. Think of it as a nine day data dump of Pythonic knowledge straight to your brain!

When it comes to the fundamentals of Python, the tutorials are a great way to hit the ground running. How do you think I learned? Also, there are dozens of beginner talks designed to introduce you what highly qualified people think you should be doing. Finally, the sprints are a great way to work with real experts for days - because even the most advanced projects needs people to knock out the invariable score of simple bugs, do documentation and write additional tests.

Also, Zed Shaw is going to teach his Learning Python the Hard Way tutorial throughout the conference. (follow that link!) To summarize, besides going over his lessons and some basic conference coaching, he's going to take his class to conference talks and then bring them back to apply what was learned. He won't be doing it alone either - a number of other python folk are going to volunteer their time to help, and I'm going to be one of them.

Because you are old to Python
A good chunk of the tutorials are designed specifically for experienced Pythonistas wishing to expand their knowledge (OMG Raymond Hettinger). And then as we all know the conference itself has scores of advanced talks designed to challenge you. Finally, what better place to work on your favorite project or get people to work on your project then the massive Pycon sprints ?

Want to do Python related technology full-time? What better place to look then where amazing companies and organizations hang out with the intention of hiring people? And invariably some of those hiring groups will be hosting parties too...

Because you are recruiting
Looking for good staff to do Python, Django, Plone, Pyramid, wxPython, NoSQL, Linux admin, Unix admin, BSD admin, Windows admin, Science, or Engineering work? Pycon will be where 1500 of the best and brightest people on the planet will hang out for over a week and some of them will be interested in new opportunities. Sponsorship is a great way to get yourself noticed by hundreds of Pythonistas.

Because it is cheap
Until January 25th Pycon registration is at its early bird prices. Even when it goes up it is still a pretty good deal. Admittedly the biggest expense is the hotel ($159/night) but there are decent and much cheaper hotels ($80/night last I checked) within a few blocks of the conference.

Saturday, January 15, 2011

January Mongo LA conference

Back in the mid-1990s my professional software development career started in relational databases. Periodically though I interacted with NoSQL databases. In 1999 I heard about ObjectStore. In 2003 I played with a few XML databases. With XML databases of the time, I found all you got out of them was a lot of complexity bolted onto a SQL based system. In 2006 I was introduced to ZODB, the Zope stack's object oriented database. ZODB has some fascinating traits, but the hard schemas used by Plone and Zope made it as rigid/stable as SQL systems but without as many useful tools. In 2008 I played a bit with Google's BigTable via appengine, where my impression was that of a relational database without indexes.

Since then, a lot of new NoSQL solutions that have embraced the idea of schema-less architectures have presented themselves. I've glanced at them but until recently nothing on my plate really justified their use and taking the time to learn how to use them. Recently I've come across a project that justifies the whole document store approach used in systems like MongoDB, CouchDB, and others. However, because users of NoSQL tend to be such heavy kool-aid drinkers, I've been a bit shy.

Well, last night Media Temple laid out an awesome spread for Mongo Los Angeles. The agenda was clearly a kool-aid fountain of information, but at least they weren't trying to sell me a timeshare, right? Plus, it gave me a chance to hang with awesome python folk like Audrey Roy and Brian Luft.

Most of the talks were will implemented, I've picked out two presentations out for being just plain well done:

Building your first MongoDB Application
Antoine Girbal delivered a talk that was a great, elegant introduction to MongoDB. In thirty minutes he gave a solid introduction to why Mongo was created, how the data is structured, how to call data, how to index it, and more. And yet it didn't feel like a firehose of information. This is how it should be done for any introduction to any open source project.

Beyond Logging: Using MongoDB to Power a Private Social Network
This was the pièce de résistance of the evening, a presentation on mating MongoDB with an existing relational database design. It was incredibly informative and demonstrated that with a bit of moderation and discipline you can make the very difficult rather easy. Plus the presenter, Justin Jenkins educates via learnmongo.com.

Have I drunk the kool-aid?
So what did I get out of these introductory talks? Well, it appears that MongoDB is exactly what I need for an upcoming Django project. The downside is that if I use MongoDB for all the persistence for this Django project then I lose the chief advantage of working with Django. I'm not talking about the admin and ORM themselves cause I know django-nonrel and mongoengine exists, I'm talking about the multitude of efforts that support the relational database roots of Django.

Also, this project involves quite a bit of information best stored in a relational database. Not everything is a document! And I know from a lot of experience that trying to fit a spiffy square peg into a round hole is dangerous. So what I'll probably do is use PostGreSQL for the accounting information and user management. The documents will be stored in MongoDB, with one of the indexes for said documents being on the username attribute of each document.

Simplicity itself, right?