Posts tagged with 'django'
Posted on 9th October 2007. Tagged as django, web, mampi, txtmyteam
I've been making some good progress recently on a few of my projects.
We're in the final stages of getting Mampi Hosting ready for launch. We've bought the hardware (lots of it), got the website ready, and our marketing campaign is prepared (we're going for an Adwords campaign, and a UK-only print campaign in a few magazines). We've been very lucky to have some great feedback from our thirty or so beta customers, so we're really looking forward to our launch. It should be great fun.
My personal side project, txtmyteam.com is also progressing well. From the outset I've tried to write a nice clean system for sending the group SMS messages which the application will need. It's been pretty well tested up to now (I've spent about £200 on SMS messages in the last three months :-P), and now it's time to move forward with building the site around the system. I've had a decent response on the beta signups, too.
Quite ridiculously, the site which I've made the most money from recently is allhailtechnoviking.com. Of course, anything which combines the fine flavours of both techno music and vikings was bound to be popular.
Posted on 20th September 2008. Tagged as django, event, djangocon
I realise I'm ridiculously late to this party, but I'm just catching up with the videos from DjangoCon 2008. I've seen quite a few amusing talks this year (hat tip to Matt and Matt's talk at dConstruct, which gets second place), but Cal Henderson's "Why I hate Django" is one of the best.
Djangopony now makes more sense, anyway.
Posted on 26th September 2008. Tagged as django, python, tips
Previously, I've often used a combination of django.contrib.auth and the login_required decorator as a simple way of controlling access to certain parts of an application. However, I'm working on a fairly complex application right now, which will grant access based on the is_staff and is_superuser fields.
It's trivial (and well documented) to use the user_passes_test decorator in a view, but in my case I'm using generic views. This is not so well documented. Here is a basic example of how to do it:
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import user_passes_test
staff_required = user_passes_test(lambda u: u.is_staff)
superuser_required = user_passes_test(lambda u: u.is_superuser)
urls = patterns('',
(r'^staff_only/$', staff_required(generic.view.here), { ... }),
(r'^super_only/$', superuser_required(generic.view.here), { ... }),
)