Done, and gets things smart.
I use Django signals a lot in my professional work, mostly to create specialized tables that track events in the ecosystem of social networking sites that I build. For example, if I make a post on a social networking site, that causes an event that creates a signal. That signal will be heard by, for [...]
I needed some rails-like environment settings using Django. This is the quick and easy way to get that done. First, after building your “settings.py” file, create an environment under your project root named “env“. Move your settings.py file to this directory, rename it “development.py” Now, in your root directory, open up a new file named [...]
23Sep
Posted by Elf Sternberg as django, programming, ruby
Ah, the bleeding edge. It’s a war out there! This morning, Facebook released fbwatir. I’ve just spent the past few hours knocking it around, and have come to the conclusion that it’s pretty mega-borked but it can be saved. In fact, I now have it working with Cucumber and Firewatir. There are several major flaws [...]
Sigh. I’ve just spent the last few hours wandering around the various “open source” analytics programs trying to find the exact right fit for what I want. I’m not finding it, which means that (headache ahead) I may have to write something myself. There’s a django-analytics placeholder in GoogleCode, but it’s empty. I at least [...]
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, [...]
16Sep
Posted by Elf Sternberg as django, python, web development
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, [...]
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 [...]
31Aug
Posted by Elf Sternberg as django, javascript, python
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: request.facebook.stream.publish( message = render_to_string(template_path, fb_context), action_links = simplejson.dumps( [{'text': "Check Us Out!", 'href': "http://someurl.com"}]), target_id = ‘nf’) See that ‘nf’ down there in target_id? It’s not on any [...]
20Aug
Posted by Elf Sternberg as django, programming, web development
One of the nifty things that Django provides is the {% url backreference %} syntax, which allows you to name the targets in your list of URL objects and then refer to them by an explicit name. You can sometimes use the function name instead, and Django has a way of turning the function name back into the [...]