feature request: Bonjour support

2 views
Skip to first unread message

evariste

unread,
Oct 16, 2006, 8:06:02 PM10/16/06
to Django developers
One thing I really love about TurboGears, that would make developing in
Django that much sweeter, would be Bonjour support. It looks like a
pretty trivial piece of code in TurboGears's startup.py file, but I'm
extremely new to Django and wouldn't know where to start adding it
myself.

Clint Ecker

unread,
Oct 16, 2006, 11:10:36 PM10/16/06
to django-d...@googlegroups.com
You're probably going to have to elaborate a bit further. What
exactly is "bonjour support" ? Does it have anything to do with the
technology formerly known as Rendezvous in OS X (more commonly known
as ZeroConf)?

--
Clint Ecker | STONE WARD
440 N. Wells, Suite 750, Chicago, IL 60610
Boston | [ Chicago ] | Little Rock
www.stoneward.com

evariste

unread,
Oct 16, 2006, 11:29:59 PM10/16/06
to Django developers
The technology formerly known as Rendezvous, yes. When you start a
turbogears project with start-projectname.py, tg tells Bonjour of its
existence and you can view it simply by pulling it down from the
Bonjour menu in Safari's Bookmarks Bar. If the project is stopped, the
site is removed from Bonjour. It's way easier than typing
http://localhost:port in the address bar. It would be nice if I could
do python manage.py runserver, then just switch to Safari and pull the
site down from the Bookmark Bar.

Guillermo Fernandez Castellanos

unread,
Oct 17, 2006, 4:33:55 AM10/17/06
to django-d...@googlegroups.com
Hi,

There is a pyzeroconf module [1] and it seems pretty easy to use [2].
Just find in the code where it does assign the IP address, and insert
the 15 lines you need to advert the service. Should be pretty easy.

Now, the problemis, Django tries to use as little dependencies as
possible, and this would be one. But there has not been any new
release since a year and a half, so it might be pretty stable.

Enjoy,

G

[1] http://sourceforge.net/projects/pyzeroconf
[2] http://www.amk.ca/python/zeroconf

Clint Ecker

unread,
Oct 17, 2006, 11:34:19 AM10/17/06
to django-d...@googlegroups.com
Not to mention it's only going to satisfy an extremely small niche.
How many people are actually developing Django apps in Safari on OS X?
Most developers I know on OS X (myself and my office included) aren't
using Safari in any capacity. Seems like adding complexity and
dependencies for no good gain.

You say it's just as easy as pulling down the bookmark bar in Safari,
but in my browser (Firefox) I just type "lo" and the bar autocompletes
for me--I think Safari does this too, right? I don't think I've fully
typed out "localhost:8000" in quite a while :)

--
Clint Ecker | STONE WARD
440 N. Wells, Suite 750, Chicago, IL 60610
Boston | [ Chicago ] | Little Rock
www.stoneward.com


On 10/17/06, Guillermo Fernandez Castellanos

Michael Twomey

unread,
Oct 17, 2006, 11:50:57 AM10/17/06
to django-d...@googlegroups.com
Turbogears just uses the command line tools if they are available, no
need to drag in any library dependencies. Another advantage of this
approach is that it works on any platform with the bonjour command
line tools, not just the mac.

You can see it in action here:
http://www.turbogears.org/svn/turbogears/trunk/turbogears/startup.py

Look for 'def start_bonjour():"

cheers,
mick

Cheng Zhang

unread,
Oct 17, 2006, 12:24:07 PM10/17/06
to django-d...@googlegroups.com

That's one neat idea we could learn from TG. With the TG's code as an
example, it shouldn't be hard to put up a patch.


-Cheng Zhang
http://www.ifaxian.com
1st Django powered site in Chinese ;-)
http://www.aiyo.cn
Our 2nd Django powered site in Chinese

ska...@gmail.com

unread,
Oct 18, 2006, 12:25:30 PM10/18/06
to Django developers
That is cool. Especially if there is no extra library dependency. It
is these little "nice to haves" that can add that extra bit of polish
to Django.

On Oct 17, 10:24 am, Cheng Zhang <czhang.ml...@gmail.com> wrote:
> On Oct 17, 2006, at 11:50 PM, Michael Twomey wrote:
>
> > Turbogears just uses the command line tools if they are available, no
> > need to drag in any library dependencies. Another advantage of this
> > approach is that it works on any platform with the bonjour command
> > line tools, not just the mac.
>
> > You can see it in action here:
> >http://www.turbogears.org/svn/turbogears/trunk/turbogears/startup.py
>
> > Look for 'def start_bonjour():"That's one neat idea we could learn from TG. With the TG's code as an
> example, it shouldn't be hard to put up a patch.
>

> -Cheng Zhanghttp://www.ifaxian.com
> 1st Django powered site in Chinese ;-)http://www.aiyo.cn

evariste

unread,
Oct 18, 2006, 3:29:48 PM10/18/06
to Django developers
Clint-You sound skeptical of the utility of adding Bonjour. I'll try to
reason why I think it's important for Django to have this.

Is Django competing for mindshare among web developers? Every little
bit of polish matters. TurboGears already has this, and you can bet
that as Apple integrates Rails into Leopard, they're thinking about
"fit and finish" stuff like this.

It's always a really nice feeling when you get a little surprise like
finding the website you're developing in your Bonjour bar. "Wow:
someone thought of that." It gives you (well, me anyway) a nice tingle
and makes a positive emotional connection-much like the feeling I got
when I realized how much work Django's free Admin app saves me.

This kind of stuff evangelizes itself.

If you're developing more than one Django site at the same time,
they'll show up by name in Bonjour, instead of localhost:port. While I
can keep it straight that MisterWidget is running on localhost:8000,
CrazyBlog is running on localhost:8020, and MyWebStore is running on
localhost:8080, why should I have to? It's much nicer to hit the
Bonjour bar and pull them down by name. While this is a contrived
example, I think it illustrates the point nicely.

I don't actually use Firefox at all, other than to make sure my
websites look and behave normally in it. I simply dislike the browser.
I use Opera and Safari. Camino (the Mac-native browser with a creamy
Gecko core) also uses Bonjour, so it would be useful to non-Safari Mac
devs as well.

If no one has added this by the time I'm more proficient in Django's
innards (I've only got about 8 hours' total experience in Django and I
haven't even finished my first tutorial yet), I'll submit a patch
myself and hope it gets accepted. It's worth doing and worth having.
And it's easy! The TurboGears code to do this, in their setup.py, is
not very many lines of code.

Jure Čuhalev

unread,
Oct 19, 2006, 6:47:40 PM10/19/06
to django-d...@googlegroups.com
On 10/18/06, evariste <mr.o...@gmail.com> wrote:
> If no one has added this by the time I'm more proficient in Django's
> innards (I've only got about 8 hours' total experience in Django and I
> haven't even finished my first tutorial yet), I'll submit a patch
> myself and hope it gets accepted. It's worth doing and worth having.
> And it's easy! The TurboGears code to do this, in their setup.py, is
> not very many lines of code.

Well it turns out it is not so trivial. It took me a good amount of
evening to come up with first version of this patch.

You can get it from here: http://code.djangoproject.com/ticket/2933

Right now I tested only on OS X 10.4.8 and I don't have prior
experience with Bonjour so getting some feedback from people who
actually use these Bonjour capabilities would be nice.

Also for some reason the way TurboGears do the Bonjour thing didn't
work for me so I turned around a bit their code and probably broke a
lot of usage scenarios. But at least now you have a patch to test.

regards,
Jure Cuhalev

evariste

unread,
Oct 19, 2006, 7:07:31 PM10/19/06
to Django developers
Wow! I can't wait to try this out later tonight. Thanks, Jure!

Reply all
Reply to author
Forward
0 new messages