Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2004, 02:33 AM
jacktasia jacktasia is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: Lawrence, Kansas [KU]
Posts: 1,559 jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 14 h 4 m 35 sec
Reputation Power: 9
Send a message via AIM to jacktasia
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:
Sorry, MySQLdb was not installed on our servers. We can't install custom modules on our servers as you are on shared hosting environment.


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.

Reply With Quote
  #2  
Old October 24th, 2004, 07:21 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 8
Send a message via MSN to Grim Archon
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 ***

Reply With Quote
  #3  
Old October 24th, 2004, 11:53 AM
jacktasia jacktasia is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: Lawrence, Kansas [KU]
Posts: 1,559 jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 14 h 4 m 35 sec
Reputation Power: 9
Send a message via AIM to jacktasia
Quote:
Originally Posted by Grim Archon
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



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?

Reply With Quote
  #4  
Old October 24th, 2004, 10:52 PM
kancha kancha is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 23 kancha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 48 m 25 sec
Reputation Power: 0
Quote:
Originally Posted by jacktasia
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:


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


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

Reply With Quote
  #5  
Old October 25th, 2004, 06:25 AM
jacktasia jacktasia is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: Lawrence, Kansas [KU]
Posts: 1,559 jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 14 h 4 m 35 sec
Reputation Power: 9
Send a message via AIM to jacktasia
Quote:
Originally Posted by kancha
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


unfortunately, i don't have shell access. any other ideas? / how to get those other modules working?

thanks

Reply With Quote
  #6  
Old October 25th, 2004, 06:56 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 8
Send a message via MSN to Grim Archon
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

Reply With Quote
  #7  
Old October 25th, 2004, 07:18 AM
jacktasia jacktasia is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: Lawrence, Kansas [KU]
Posts: 1,559 jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 14 h 4 m 35 sec
Reputation Power: 9
Send a message via AIM to jacktasia
Quote:
Originally Posted by Grim Archon
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


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

Reply With Quote
  #8  
Old October 25th, 2004, 08:17 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 8
Send a message via MSN to Grim Archon
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > python and mysql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT