Questions tagged [cgi]

1) The Common Gateway Interface is a standard defining how web server software can delegate web page generation to a stand-alone application or executable file. 2) Computer Generated Imagery

This tag is mostly used for the Common Gateway Interface (CGI), which is a standard (see RFC 3875: CGI Version 1.1) that defines how web server software can delegate the generation of web pages to a stand-alone application, an executable file. Such applications are known as CGI scripts; they can be written in any programming language, although scripting languages are often used.

Less commonly on Stack Overflow, CGI may also be used to tag questions regarding Computer Generated Imagery.

See also

5191 questions
12
votes
3 answers

disk I/O error with SQLite

I have a (tiny) dynamic website that is (roughly) a Perl CGI script using a SQLite database. Package DBI is the abstraction layer used in Perl. About one week ago, I started to see this error message: disk I/O error(10) at dbdimp.c line 271 Since…
kevinarpe
  • 20,319
  • 26
  • 127
  • 154
12
votes
6 answers

Executing a Python script in Apache2

I am trying to execute a Python program using Apache. However, Apache will only serve the file and not actually execute it. The permissions on the file are r/w/x and it is in /var/www. I will post the contents of httpd.conf and the program code…
tpar44
  • 1,431
  • 4
  • 22
  • 35
12
votes
3 answers

Will everything in the standard library treat strings as unicode in Python 3.0?

I'm a little confused about how the standard library will behave now that Python (from 3.0) is unicode-based. Will modules such as CGI and urllib use unicode strings or will they use the new 'bytes' type and just provide encoded data?
hacama
  • 339
  • 2
  • 5
12
votes
6 answers

Letting users upload Python scripts for execution

I understand that letting any anonymous user upload any sort of file in general can be dangerous, especially if it's code. However, I have an idea to let users upload custom AI scripts to my website. I would provide the template so that the user…
AlbertoPL
  • 11,479
  • 5
  • 49
  • 73
12
votes
4 answers

Exact opposite to Ruby's CGI.parse method?

I'd like to do some sanitization of query params. I parse the query with CGI.parse, then I delete some params, but I can't find an opposite method to build the query. I don't really want to do something like params.map{|n,v| "#{CGI.escape…
Leonid Shevtsov
  • 14,024
  • 9
  • 51
  • 82
12
votes
2 answers

Is it possible to write data into own stdin in Linux

I want to debug my cgi script (C++) from IDE, so I would like to create a "debug mode": read file from disk, push it to own stdin, set some environment variables, that correspond this file and run the rest of the script as it was called by the web…
Nemo
  • 155
  • 1
  • 7
12
votes
5 answers

My first web app (Python): use CGI, or a framework like Django?

I don’t want to burden you all with the details, but basically I’m a 2nd year compsci student with no Web dev experience. Basically I want to create a small “web app” that takes in input from a html form, have a python script perform some…
p0ny
  • 329
  • 1
  • 3
  • 11
11
votes
3 answers

How does cgi.FieldStorage store files?

So I've been playing around with raw WSGI, cgi.FieldStorage and file uploads. And I just can't understand how it deals with file uploads. At first it seemed that it just stores the whole file in memory. And I thought hm, that should be easy to test…
Justinas
  • 347
  • 2
  • 4
  • 10
11
votes
2 answers

How to parse the "request body" using python CGI?

I just need to write a simple python CGI script to parse the contents of a POST request containing JSON. This is only test code so that I can test a client application until the actual server is ready (written by someone else). I can read the…
Christopher
  • 5,806
  • 7
  • 31
  • 41
11
votes
2 answers

Strategy for migrating Perl CGI to Template Toolkit?

I have a relatively large legacy Perl/CGI/DBI web application which generates HTML on-the-fly piece by piece. We are reworking the HTML being produced, to come in to compliance with HTML 5 / CSS 3. This would be a good time to move to some sort of…
Edward Barnard
  • 346
  • 3
  • 17
11
votes
3 answers

Run Python CGI Application on Heroku

I made a simple application that makes use of Python CGI scripts. I have a working local version (works fine with lighttpd), but now I'd like to upload it to Heroku. The application consists of 2 or 3 scripts that make operations on a file and print…
user1002327
  • 533
  • 2
  • 8
  • 23
11
votes
1 answer

Why did Perl say() not append newline in FCGI mode?

I have a strange behaviour with Perl's say function in FCGI mode. Newlines won't be append. Why does this happen? Sample code: #!/usr/bin/perl -wT use strict; use warnings; use utf8; use feature qw( say ); use FCGI (); use CGI qw( header ); my $cnt…
burnersk
  • 3,320
  • 4
  • 33
  • 56
11
votes
4 answers

How can I serve unbuffered CGI content from Apache 2?

I would like to be able to allow a user to view the output of a long-running GCI script as it is generated rather than after the script is complete. However even when I explicitly flush STDOUT the server seems to wait for the script to complete…
Dave Forgac
  • 3,146
  • 7
  • 39
  • 54
10
votes
2 answers

Path routing in Flask

I want to run a Python CGI on a shared hosting environment. I followed Flask's example and came up with a tiny application as below: from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello…
sdc
  • 101
  • 4
10
votes
2 answers

Secure data transfer over HTTP when HTTPS is not an option

I would like to write an application to manage files, directories and processes on hundreds of remote PCs. There are measurement programs running on these machines, which are currently managed manually using TightVNC / RealVNC. Since the number of…
kol
  • 27,881
  • 12
  • 83
  • 120