This content has been marked as final. Show 6 replies
your web server should have access and error logs. the error log specifically might contain useful error output messages that could help you track down the problem. is reg.cgi executable in its location? does its #! at the top point to the correct location of your python interpreter? does the script point to the correct location of the database? can you use a tool like "curl" (or just your web browser) to access the web service manually, to make sure it's doing the expected?
having "localhost" as the hostname for your webservice url shouldn't be a problem as long as you're only trying to access it from the same computer where it's running.
hi micheal ,
thank you for your response,
i am using windows so i don't think the interpreter would be a concern since it is for UNIX portability of python but i have givent he intertretter path at the top too, and i also found the script from my browser (manually)...and also the database...
i am getting a "register faliure error"...what could be posibly wrong???
i guess it could be my db not getting updated from python..
if you have suggestions please lemme know...
thnks in advance
when you access the script manually from your browser, do you get xml output suggesting the script ran, or do you get the source code of the script suggesting that it is *not* running, but just being returned as a plain document? for example, if you try to connect to your service from your browser with
(assuming you put it in "cgi-bin" and it's called "reg.cgi", on a computer called "hostname"), you should get back XML that looks like
<?xml version="1.0" encoding="utf-8"?>
check the log files of your web server to see if there are error messages that might suggest what the problem is (exceptions from python, for example).
thanks mike for your response...
but i am getting the xml result in the browser thts wht i treid to explain in my reply,
and its also gvin me the reply to post methods to friends,
but wen i tried inserting values to the datbase through the insert query (c.execute )
the database is updated wen i hardcode the user and identity, the xml result was true, wen i took the db i culd see the new tuples too..
wen i tried '?' and entered the details it came as update false in the xml and db was not updated too
the user and identity is getting printed b4 the execute query so i guess it culdnt be the prob of local or global declaration?
...so...i am kinda puzzled with the python script now maybe coz i am new to python...
if u got any more suggestions/advice plz let me know....
thanks in advance
update=false means that an exception occurred in the insert query. that suggests it doesn't like the "?" notation used in the query string.
when you have something in the database, can you retrieve it using the "friends=username" HTTP query string? if that returns the value you inserted manually into the database, then the sqlite3 module understands the "?" notation in the query string. if it does not, that suggests that your sqlite3 python module is older and doesn't use that notation. older versions of the sqlite3 python module use "%s" instead of "?" in the query string for parameter substitution. if the lookup query doesn't work, try changing the "?"s to "%s" in the two SQL queries in the script.
from your python interpreter, you can check the version of the sqlite3 module by doing
>>> import sqlite3
please post what version your sqlite3 python module is. the one on my computer where "?" works is '2.3.2'.
hi mike thanks for ur replies,
i am using SQLite expert professional.7.7 and sqlite library version 3.6.7
so could it be the issue with my db nad python..i am geting friend list from db so i think it understands the '?'..it also takes " %s "
thanks in advance mike