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.
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
On 10/16/06, evariste <mr.ora...@gmail.com> wrote:
> 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.
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.
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.
> 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.
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
> 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.
> On 10/17/06, evariste <mr.ora...@gmail.com> wrote:
> > 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.
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.
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.
> 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.
> > 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.
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.
On 10/18/06, evariste <mr.ora...@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.
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.