On 12/30/05, Michael Hipp <[EMAIL PROTECTED]> wrote:
> But what about the "root" of the website, how do you specify a view for just
> "mysite.com"?

To target the root, use '^$' as the regular expression, like so:

urlpatterns = patterns('',
    (r'^$', 'path.to.my_view'),
)

Does this answer your question?

> Thanks. What about the case where I need to get debugging output from deep in
> a routine and no obvious (to me, at least) way to bubble it up into the web
> browser?

A simple solution is to raise an exception at any point. It'll bubble
up to the Web browser as long as you have DEBUG=True. (If you have
DEBUG=False, Django will attempt to send an e-mail with the full
traceback to the people defined in the ADMINS setting.)

Personally I use "assert False" for this. For example, if I wanted to
see the value of variable foo, I'd do this:

    assert False, foo

Hope that helps,
Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Reply via email to