|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
python and mysql
hey all,
i am trying to do my server-side stuff in python now instead of php because php just gets far too messy for my taste. so cleary i need to use databases and i just found out my server doesn't have the MySQLdb module installed. and when i contacted them about it they said: Quote:
i also have PostgresSQL on my server but i having a hard time figuring out what module or whatever i exactly need to work with it.... so anyway, my questions: 1. is there another way to access mysql besides MySQLdb? 2. what's the best way to work with PostgresSQL, if mysql is out of the question? i don't do heavy database stuff, but i NEED a database to work with so i am just looking for...something. thanks ![]()
__________________
Jack --------- use code tags become vegetarian python? yes, sir! unarm.org get firefox If I helped you then please click the " " in the upper right-hand corner of my post.
|
|
#2
|
||||
|
||||
|
Both interfaces to MySQL and PostgresSQL use a compiled C extension which is where the problem lies. I found a pure Python interface here but I don't know how good it is:
http://sourceforge.net/projects/pysqldb My host is the same, it claims Python support but basically says it's there to support Mailman only. Gadfly is a pure python database making no use of external technology and it has an SQL interface. grim
__________________
*** Experimental Python Markup CGI V2 *** |
|
#3
|
|||
|
|||
|
Quote:
okay, awesome - thanks ![]() now in hopes of not sounding too stupid: how do i install these if i only have remote access to the server? |
|
#4
|
|||
|
|||
|
Quote:
If you have shell access (not necessarily root) then u can compile a mysqldb and update your sys.path to point to that directory. kancha. www.developers.net.np |
|
#5
|
|||
|
|||
|
Quote:
unfortunately, i don't have shell access. any other ideas? / how to get those other modules working? thanks ![]() |
|
#6
|
||||
|
||||
|
This applies to normal cgi files:
If you execute a python file in cgi-bin then that directory and possibly it's sub-directories will be in the path. If you create a python sub-directory in cgi-bin and in that sub-directory create an empty __init__.py file you should be able to keep python stuff separate. You then put all your support modules into the python sub-directory. Your modules would then have a prefix of python To keep code compatible you could use: import python.mymodule as mymodule So for your particular problem, I suggest you install the package on a local machine and then copy the complete package (ftp) to the python sub-directory. grim ![]() |
|
#7
|
|||
|
|||
|
Quote:
awesome, thanks again grim ill probably end up doing that.i am seriously considering signing up for Plan 1 at http://www.python-hosting.com/ because it has most "common" modules installed and gives you shell access to install anything you want...seems like a pretty awesome deal, any comments on it? thanks again ![]() |
|
#8
|
||||
|
||||
Looks like you have your problem sorted with that host and it looks a good deal ![]() It's maybe a surprise but I went for all round quantity over specific python support with Lunarpages. (They specifically exclude Zope/Plone). I'm still in the site building phase (learning Mambo) at the mo' but haven't run into any issues except the C extension one.My Python code markup cgi works from that site so at least I know all the core modules are available. (I'll add C module compilation to the list of experiments to try on it). grim ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > python and mysql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|