Copying things from request.META to the env parameter of Popen allows
me to get the cgi off the ground. Now I have the problem that the cgi
is generating a cookie and content type, which django returns to the
browser as page content.

Is there a way to pass it back transparently? Or, failing that, can
someone point a newbie to an appropriate method to parse the header so
it can be used to create a HttpResponse?



On Mon, Dec 6, 2010 at 7:06 PM, Wayne Smith <wayne.tuxro...@gmail.com> wrote:
>
>
> On Mon, Dec 6, 2010 at 4:42 PM, bc <craft.br...@gmail.com> wrote:
>>
>> Is there any simple way to use django authentication/authorization to
>> control access to an existing (not django) cgi?
>>
>> I could use subprocess.Popen to invoke the cgi after checking
>> authorization, but the environment needs to be set up to look like a
>> cgi call (setting QUERY_STRING, etc.). Is there a better way?
>>
>
> I don't know if you could do some special trick with an HttpRequest or some
> kind of redirect from one view to hit the cgi script with the automatically
> created (HttpRequest) data.  I'm guessing the answer is no or more trouble
> than it would be worth, but that's just a guess.
>
> I would say you really have two options.
>
> 1.  Implement the script in Python, and bring it in under Django.
>
> 2.  Craft your own Http Request header with Python's libraries and point it
> to the cgi script.
>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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

Reply via email to