I am a C/Objective-C/Swift developer, mostly for mobile platforms.
I've done a little PHP server-side work, but very little.
I'm hiring my son (who's a sophomore in college studying CS) as a junior developer to do some server-side work for a client project I'm working on (for iOS and Mac). He knows Python fairly well, but hasn't done server work with it before.
(This is a custom app that will issue formatted HTTP GET and POST requests, not a web interface.)
Since he knows Python, and the consensus I've seen on the net is that Python is a cleaner, more modern language than PHP, we're going to use Python, not PHP, for the server scripting language.
Thus I'm doing a little digging on his behalf.
When I need to invoke a PHP script on the server, I might use a URL like this:
http://domain/path/script_name.php?key=value
On the server, this invokes the script script_name.php at the specified path, and passes it the URL.
Do you use the same technique with Python scripts?
Would sending the URL
http://domain/path/script_name.pyc?key=value
Do the same thing? (Invoke the python script and pass it the URL)
Is there any configuration you need to do server-side in order to invoke your Python script with a client-side URL?
And what tools/libraries do you recommend to support the Python development?
The server will be a Mac running OS X server, connected to an SQLite database. It will be responding to requests from the client by looking up records in the SQL database and returning them in JSON, and accepting posts from the client, also formatted in JSON.
This is a pretty low-volume application, so performance of a simple Python script should be adequate (a couple of dozen client apps, with fairly low traffic.)
After doing a little more digging, I found FastCGI and mod_wsgi. It sounds like mod_wsgi is a good fit for my needs.
Aucun commentaire:
Enregistrer un commentaire