title: Using CGI scripts in Django
body: <p>I have a script I'm using to handle form information in the background on my Django server, and it's not giving me any results. Here's part of my views.py file: </p>
  
  <pre><code>def run_cgi(request, question_id):
      q = get_object_or_404(Question, pk=question_id)
      return render_to_response('{{ STATIC_URL }}run_cgi.cgi', {'time_overlap': q},context_instance=RequestContext(request))
  </code></pre>
  
  <p>From what I gather, {{ STATIC_URL }} references the static folder in the Django directories, where I stored the CGI script. The HTML page is stored in the templates folder, and pointed to using the urls.py file. The HTML consists of two radio buttons (YES/NO), which should be passed to the CGI script. The problem is the CGI script does nothing. Here's the output from the server:</p>
  
  <pre><code>[09/Feb/2012 17:41:40] "GET /assert_facts/ HTTP/1.1" 200 689
  [09/Feb/2012 17:41:42] "POST /assert_facts/run_cgi.cgi HTTP/1.1" 200 689
  </code></pre>