December 2010
1 post
4 tags
GG.pl REST API: python-ggapi
Yesterday, we’ve released simple implementation of GG.pl API. GG.pl is Facebook-like site based on most popular polish IM - Gadu-Gadu.
python-ggapi is a client library that allows you to send notifications to users, get their data from public directory, and post to dashboard.
More about GG.pl and it’s API: http://dev.gg.pl (in polish).
Library is licensed under OSI BSD license. For...
August 2010
3 posts
5 tags
Tumblr: QuickTumble Safari Extension
We made simple extension for Safari 5 which allows you to quick post to tumblr. It is called QuickTumble and can be obtained here for free.
Currently it provides:
toolbar button - toggles bar with shortcuts to add different media types to tumblelog (text, photo, link, etc.)
“Tumble Link to this Page” context menu for quick posting links to currently browsed page
“Tumble...
6 tags
Django: detect user's first login
Sometimes we want to detect information about user’s first login, e.g. to show account detail or edit form.
First thought would be to look at last_login field in User model, but… it is filled with date after user signed up and doesn’t logged in yet.
So, can we assume that User.last_login and User.date_joined fields have equal value after registration? I think it is too risky -...
4 tags
Facebook: Profile tab with your GitHub...
We made simple application for Facebook allowing you to display your open source (public) repositories stored on GitHub. Obviously, it’s called GitHub Repositories and is available here: http://www.facebook.com/apps/application.php?id=120729024640004.
Here’s how it looks:
For live demo go to our Facebook page.
It is very simple at the moment - when you connect app to your profile...
July 2010
2 posts
3 tags
Django: How to see if model instance was changed...
There are situations when you want to know when model instance was changed. E.g. slugs generation when you change title (or maybe this example is discussable when comes to SEO?).
SEO matters but there are some real-life situations when you need this - let’s look at following example:
- you’re using django-mptt or some other method to store your document tree,
- URL to your document...
5 tags
Django: register user with invitation code →
We made custom backend for django-registration app allowing you to simplify your service beta testing by require an invitation code from user.
Try it, it’s open source and free to fork and modify!
Remember that generation and distribution of codes is up to you.
June 2010
1 post
1 tag
Django/OpenSource Scalability
Django is great. No doubts about it. But - sometimes comes the question of scalability, especially in a time-and-budget constrains. Well - the very least we can say is that - our client suddenly decided that he needed about 200 rqs - yes, that’s 200 hundred requests per second - and yes, that’s 1728.000 requestes per day. Well, no problem in achieveing that - so far there’s no...
May 2010
4 posts
1 tag
1 tag
6 tags
Django: the easiest way to run manage commands in...
Sometimes there are some management commands I would like to run from crontab at given time or interval. There are some ways when you import setup_environ from Django but there is much simpler solution.
For example - Haystack search index update. Let’s do it in one hour interval.
user@server:~$ crontab...
6 tags
Mac OS X: ⌘ + ⇥ and Dock stops working
If your Dock stops responding (e.g. cannot click application icon) and you can’t switch between applications using ⌘ + ⇥ (Command + Tab) there is an easy way to deal with it without restart.
Just open Activity Monitor (typically ⌘ + ␣), find Dock process and kill process using “Quit Process” option. Dock should be restared after a second and everything should back to normal.
April 2010
2 posts
5 tags
Django: how to mark required form field with *?
If you want to mark required fields with * or some other text/symbol - don’t use some hacks in your python code (Label modify in form class, etc.). Things like that should reside in templates and all you need to do is to apply this:
{% if field.field.required %} <em>*</em>{% endif %}
E.g. form display template:
<form action="." method="post">
{% csrf_token %}
{% for hidden...
1 tag
We will either find a way, or make one.
– Hannibal