Archive for the ‘python’ Category

This is part 4 of a series. So far, we’ve written a basic Django application, written some tests for it, checked everything into a central repository, and then integrated those tests with the Hudson continual integration server. But Django’s tests run in a kind of pseudo-server mode, with both the tests and the application running […]

For the past few days, this has been bugging the Hell out of me and I finally decided today to knuckle down and figure out how the hell Python decorators-with-arguments work. Basic Decoration The basics: A python function takes arguments, performs a task, and returns a value. A decorator takes as its argument a function, […]

Google last week released Google Go, a new programming language designed to be “more C-like” (a kind of python/C#/Java mash-up of a language) with support for Erlang’s excellent concurrency management, which allows you to write programs that can do lots of different little things at the same time on machines that have multiple CPU’s. It’s […]

This is part 3 of a series. In part 1 we set up a Hudson test server, and in part 2 I introduced a simple Django application with some simple tests. Now we’re going to make Hudson run those simple tests. Prerequisites: Your box for running this application must be able to run both Hudson […]

This is Part 2 of a series. Before I demonstrate how to do continual integration testing, I need a demonstration application. I’ve chosen a simple Django application, your basic echo program, with no styling or media at all. This ought to be more than enough to demonstrate base functionality. A New Django Project Start by […]

Do you have that one thing that you have to constantly look up? In python, to replace elements of a string, there are two operators.  One is a strictly linear search, the other uses regular expressions.  The regexp call to replace part of a string with another string is sub, and the string call to […]

We frequently write little functions that populate the Django context, and sometimes we want that context to be site-wide, and we want every page and every Ajax handler, basically everything that takes a request and spews a response, in our application to have access to that information.  It might the user’s authentication, or his authorization, […]

Today’s little snippet: Filtering a loosely coupled many-to-many relationship.  As revealed earlier,  I don’t really “get” the difficulty with many-to-many relationships.  I don’t even get the difficulty with signals; if you define the many-to-many manually, handling signals on it is trivial compared to trying to do it manually in one of the referring classes. Today, […]


Arrrgh. Now, repeat after me:

Posted by Elf Sternberg as django, python, web development

Repeat after me: Registration is not Authentication is not Authorization is not Utilization. Registration is not Authentication is not Authorization is not Utilization. Registration is not Authentication is not Authorization is not Utilization. I’ll keep reminding myself of that until I figure out how to disentangle the four from this damned Facebook app.  Registering to […]

The correct call for posting to a user’s facebook wall with Python and pyfacebook, after you’ve established both user authentication via FacebookConnect and gotten stream_publish permission, is: message = render_to_string(template_path, fb_context), action_links = simplejson.dumps( [{‘text’: “Check Us Out!”, ‘href’: “”}]), target_id = ‘nf’) See that ‘nf’ down there in target_id?  It’s not on any […]

Subscribe to Feed



November 2019
« Oct