473,661 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PostgreSQL & Python vs PHP

Hi,

I don't know anything about PHP and I'm initiating right now with
PostgreSQL.

Could someone tell me the pros and cons of assessing the PostgreSQL
databases with Python vs. PHP?

I will need to build a database that has to be assessed by a dozen clients
via a web page in an intranet (possibly from outside, too).

Is Python more used on the client side and PHP on the server side?

I now Python, although I'm far from being an expert.
Luis
Jul 23 '05 #1
8 2252
To be honest, this is a pretty open-ended question. Are there specific
issues (SQL injection/security, minimizing db connections, simplest
code, etc, your'e concerned with?)

To be more honest, googline "Python vs. PHP" raises lots of hits
http://wiki.w4py.org/pythonvsphp.html
http://www.redcor.ch/wikis/semi_inte...fMoreLanguages

Jul 23 '05 #2
ok, to make this less open-ended, you should mention what O/S and web
server you have in mind, whether the web and DB servers will be under
your admin (big diff betw python and PHP, as far as finding shared
server accounts at web hosts), what kinds of queries, concurrent
read/write volumes, transactions, dirtiness, etc. etc Also if you
build your questions to this newsgroup on past threads you've read, you
will get absolute superb information, I guarantee it.

Jul 23 '05 #3
gene tani wrote:
To be honest, this is a pretty open-ended question. Are there specific
issues (SQL injection/security, minimizing db connections, simplest
code, etc, your'e concerned with?) Simplest code with be an important factor, since the db will be used far
from max capabilities. Ease of use of the web page by clients is also a
main factor.

I need to build it from the server and also client side.

For the client side I'll be using Python.

But for the server side, I would like to hear some opinions. Is it worth
learning Php?


To be more honest, googline "Python vs. PHP" raises lots of hits
http://wiki.w4py.org/pythonvsphp.html

nice link :-)

Thank you,

Luis
Jul 23 '05 #4
gene tani wrote:
ok, to make this less open-ended, you should mention what O/S and web
server you have in mind, whether the web and DB servers will be under
your admin (big diff betw python and PHP, as far as finding shared
server accounts at web hosts), what kinds of queries, concurrent
read/write volumes, transactions, dirtiness, etc. etc Also if you
build your questions to this newsgroup on past threads you've read, you
will get absolute superb information, I guarantee it.

I'll be using Apache, under Linux.
The db server will be under my admin.
A dozen clients acessing the db.
For the first project:
Three or four of them will be using queries mainly from three tables with:
table 1: 3500000 lines x 20 cols
table 2: 3500000 lines x 6 cols
table 3: 42000000 lines x 5 cols
as an estimate.

Other clients will be very light users but need easy web interface for mouse
clicks only.

Thank you for your support and excuse me for my ignorance, but I'm starting
the project and would like to start it in the right direction.

Luis
Jul 23 '05 #5
On Sat, 23 Jul 2005 18:58:47 +0100, "Luis P. Mendes"
<lu*****@XXinam e.com> declaimed the following in comp.lang.pytho n:

Could someone tell me the pros and cons of assessing the PostgreSQL
databases with Python vs. PHP?
I don't think anyone got confused by the phrasing, though it
could be close...

You are /assessing/ the languages in order to determine which
will be used to /access/ the database.. <G>

Unfortunately, I can't help with the PHP side of the assessment.
I will need to build a database that has to be assessed by a dozen clients
via a web page in an intranet (possibly from outside, too).

Is Python more used on the client side and PHP on the server side?
If you are accessing via a web page, the browser is the client
-- though it may include Javascript/VBScript/Java-applets if client-side
computations are required, I don't think any handle Python applets
(maybe Jython onto the Java runtime) -- so this question doesn't really
make sense. OTOH, Python can be used for stand-alone clients working
directly to the servers using a number of protocols (for example, if the
database is network accessible [dangerous practice as anyone who can
figure out a valid username/password could connect to the database] you
can bypass the web server and browser). PHP, to my knowledge, is
incomplete in that way -- it is essentially a web page processing
language.

As for server side? I also don't know of any servers that were
written in PHP... Whereas CherryPy is a framework for making dedicated
application servers (hope the cherry pickers don't stone me -- I'm
simplifying a lot). Zope includes a server; Plone is built from code on
top of CMF, which itself sits on top of Zope -- all heavily Python
based. And Twisted is... well... twisted through all sorts of network
protocols.
-- =============== =============== =============== =============== == <
wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Jul 23 '05 #6
Luis P. Mendes wrote:
I need to build it from the server and also client side.

For the client side I'll be using Python.

But for the server side, I would like to hear some opinions. Is it worth
learning Php?


If you know Python and don't know PHP, there's little benefit from
spending the time learning it.

But, PHP is extremely simple to work with and you can produce results
VERY quickly. Part of the reason is that it's already intended to be a
web-embedded language and doesn't reqire additonal frameworks, libraries
or configuration like Python does. One thing that botheres me when using
Python in php-like way is that the "indentatio n is significant" property
becomes a nuisance when you intertwine HTML and code (which you
shouldn't be doing anyway ;) ).

The benefit of Python is that is a much cleaner language with well
defined interfaces and you'll probably maintain a large application
easier if it's in Python.

There are no significant performance differences, and no really
significant differences in programming approach.
Jul 24 '05 #7
Luis P. Mendes a écrit :
(snip)
I need to build it from the server and also client side.

For the client side I'll be using Python.

But for the server side, I would like to hear some opinions. Is it worth
learning Php?


I dont think so - unless you have no other choice !-)

More seriously, Python is at least as good (much better IMHO...) as PHP
for web applications, and the only thing (the only I can think of...)
that's really easier to do with PHP is to write unmaintainable code with
all logic and presention mixed up, global variables coming from outer
space, etc...

Another point is that, since you'll need to implement your domain model
in Python for the client app anyway, duplicating it in PHP would not
only be a waste of time, but also lead to a maintence nightmare. Using
Python on both the client and server side, you'll just have to write
specific controllers and views for the web application.

A last thing is that PostgreSQL supports Python as an extension language.

My 2 cents...
Jul 24 '05 #8
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would like to thank all of you.

For what I've read, I'll be using python instead of Php.
Luis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC5RQ5Hn4 UHCY8rB8RAi3QAK CuU3tgluOZXktbs eUmq5d6WpyGCgCf WTCK
hKweHnSkvEm/QLKwMw4uP2A=
=6asH
-----END PGP SIGNATURE-----
Jul 25 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1690
by: miguelk | last post by:
Excuse my ignorance of this subject since I don't know Python well enough. I would like to know if it's possible to access PostgreSQL (running on Lunux) from Python scripts using TDB (or TBD?). I saw that there are ways to do this but I need to do it via TDB. Since I don't know what TDB is I thought it's best to ask around before investing considerable time to get proficient in this. Any experiences out there? Thanks.
9
2411
by: W. Borgert | last post by:
Hi, I'm not new to Python, but new to databases and PostgreSQL. I like to write a PostgreSQL client application (not code running inside of the RDBMS), and Debian has four modules: python2.3-pgsql - A Python DB-API 2.0 interface to PostgreSQL v7.x python2.3-popy - module providing access to PostgreSQL from Python2.3 python2.3-psycopg - Python 2.3 module for PostgreSQL python2.3-pygresql - PostgreSQL module for Python
4
5807
by: Chuck Amadi | last post by:
Hi all Anyone know a good Pygresql Tutorial for Interfacing between Python & Postgresql . Cheers Chuck
1
2829
by: Mateusz [PEYN] Adamus | last post by:
Hi I'm a developer currently wondering which DB choose for my next project. I looked on the net found ofcourse Oracle but also came up with PostgreSQL. I heard quite few things about it, all good so I'm wondering how really it is. Till now I've been working on MSSQL and Interbase. So PostgreSQL and Oracle are pretty new to me. I would have to learn them from the start there for I have to make a wise decision :D
14
4098
by: Manuel Tejada | last post by:
Hi My box: RedHat 9.0, Pentium III Recently I upgraded from PostgreSQL 7.3.2 to PostgreSQL 7.4.1. The PostgreSQL 7.3.2's rpms were installed from RehHat CDs The PostgreSQL 7.4.1's rpms I used to upgrade were downloaded from RHEL3 subdirectory (of the mirror ftp://ftp4.ar.postgresql.org/pub/mirrors/postgresql/binary/v7.4.1/redhat/rhel3). The upgrade is working well, even I can connect to PostgreSQL from a PHP
2
1889
by: Mike Morris | last post by:
Hi, I've setup a postgres server (7.4) and confirmed that SSL is enabled - I can successfully connect via tcp socket over SSL using the psql client. From PHP4, how can I get the pg_connect function to negotiate an SSL connection? I gather from researching the issue that pg_connect uses the same libraries as psql, so that this should be possible. But I've tried every syntax I can think of... the "options" parameter to pg_connect is...
0
1023
by: Adam Smith | last post by:
Hello, I am attempting to compile postgresql from source with python enable. I have compiled & installed python on my machine according to the instruction, installation seems fine My Platform ==> # uname -a FreeBSD econ.com 4.9-STABLE FreeBSD 4.9-STABLE #0: Wed Nov 12 17:41:01 PST 2003
6
1674
by: SR | last post by:
As a starter project for learning Python/PostgreSQL, I am building a Books database that stores information on the books on my bookshelf. Say I have three tables. Table "books" contains rows for book_id, title, subtitle, ISBN. Table "authors" contains rows for author_id, author surname, author first names, biographical notes.
3
3204
by: dpholmes | last post by:
hi everyone, i'm very new to python and to this forum. i'm actually just trying to work through the tutorial on webpy.org. so far, so good, but as i tried to incorporate a postgresql database into the demo web app i'm receiving this error print out: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/web/wsgiserver/__init__.py", line 624, in communicate req.respond() File...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8754
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.