Sorry if this seems obvious I am a new comer to Django development.

There are attributes I want to get at in the request or WSGI server
objects to test if I should set up some specialized channels in my
Django application.

Problem is neither of these seem to be available until I get to the
view method call.

Specifically what I am trying to do is figure out if the server has
been run as a mod_python, FCGI process, AJP process or by the built in
test server. Then take the appropriate actions to so that print goes
to the server's access logs, print >> sys.stderr goes to the server's
error logs. I'd also like to automatically get the python logger doing
the same.

I have found that in a given view I can do something like

if 'wsgi.errors' in request.META:
   # do setup work here

I can't seem to put this code anywhere else (like in my settings.py
file) where it can get picked up by the whole system.

I am sure I am missing something here that is probably obvious and
silly.

Thanks in advance!

+ Leeland
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to