import request ? - django debugsqlshell

1,744 views
Skip to first unread message

Daxal

unread,
Apr 22, 2010, 5:08:13 PM4/22/10
to Django users
Hi,

I am trying to run a little debug code before I put it on my
testserver. I am passing in "request" variable in the django code for
the debugsqlshell but it doesn't seem to work.

>>> sresults=run_search_component(request, 'contacts')
Traceback (most recent call last):
File "<console>", line 1, in <module>
NameError: name 'request' is not defined


Anyone know what the command is to import request? I checked many
websites on google and search forums but did not find anything.

Thanks for you help.

Daxal

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

Nick Serra

unread,
Apr 23, 2010, 11:08:55 AM4/23/10
to Django users
Request is an object that django passes view functions that includes
post data, meta data, and data about the request taking place. Not
sure what your test function is doing, but to start, python is
complaining because you are referencing the variable before it has
been declared. You need to define request first. Your function might
need some valid request data to work. To start, just declare your
request first, request = []. Read up on django's request object here:

http://docs.djangoproject.com/en/dev/ref/request-response/
Reply all
Reply to author
Forward
0 new messages