Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 3rd, 2006, 9:45 AM   #1
DaveQB
Newbie
 
DaveQB's Avatar
 
Join Date: Apr 2006
Location: Sydney
Posts: 14
Rep Power: 0 DaveQB is on a distinguished road
Send a message via ICQ to DaveQB Send a message via Skype™ to DaveQB
Web app idea

I am by no means an expert Python coder, or expert any language coder.
No my disclaimer is out of the way ....

I want to build a web app with Python as i use Python alot for offline apps.
My understanding to use it as a web app language is to use the CGImodule to access URL passed variables.

My look into web frameworks seems to have them all having their own mini web server; i want to use my current Apache server.




1 of my first needs in this app is a timer. I thought i could use Javascript to countdown but then to pass that the time has expired onto the Python backend app is where i get a little fuzzy.

Any help in this field would be greatly appreciated.

Thanks
DaveQB is offline   Reply With Quote
Old May 3rd, 2006, 10:17 AM   #2
MBirchmeier
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 211
Rep Power: 3 MBirchmeier is on a distinguished road
You could post the 'time expiration' by doing a submit a python module :

Something similar to the steps shown here: http://www.c-sharpcorner.com/WebForm...CSAppKS001.asp would probablly work but the timeout could simulate the form submit.

*I haven't tested this, and i'm pretty sure there would be a better way of doing this, but it's a place to start*

-MBirchmeier
MBirchmeier is offline   Reply With Quote
Old May 3rd, 2006, 12:36 PM   #3
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4 Arevos is on a distinguished road
You can use mod_python with Apache, which is probably the best option. Running Python under CGI would remove any significant advantage using Apache would give you.
Arevos is offline   Reply With Quote
Old May 7th, 2006, 9:28 AM   #4
DaveQB
Newbie
 
DaveQB's Avatar
 
Join Date: Apr 2006
Location: Sydney
Posts: 14
Rep Power: 0 DaveQB is on a distinguished road
Send a message via ICQ to DaveQB Send a message via Skype™ to DaveQB
Thanx for the replies guys.

What a mess I made of that, my first post on these forums. Less: don't post while falling asleep.

The host that will running this app doesnt seem to have mod_python install on their apache install. So this rules out the frameworks it seems.

So I see I have 2 options

1) use CGI like URLs to pass variables

2) use PHP as a type of front end to calling python scripts to do all the work.

Any better suggestions ??
DaveQB is offline   Reply With Quote
Old May 7th, 2006, 10:25 AM   #5
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4 Arevos is on a distinguished road
Other than to get a different host?

Nope. I think those are all of your options. Without mod_python, or access to a Python-based server such as CherryPy, you're really just left with CGI.
Arevos is offline   Reply With Quote
Old May 7th, 2006, 11:36 AM   #6
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
Quote:
Originally Posted by DaveQB
Thanx for the replies guys.

What a mess I made of that, my first post on these forums. Less: don't post while falling asleep.

The host that will running this app doesnt seem to have mod_python install on their apache install. So this rules out the frameworks it seems.

So I see I have 2 options

1) use CGI like URLs to pass variables

2) use PHP as a type of front end to calling python scripts to do all the work.

Any better suggestions ??
1) Try to use POST and not GET variables so you don't throw things in the URL
2) Why would you use a backend code as a frontend to call a different backend?
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old May 10th, 2006, 12:36 PM   #7
DaveQB
Newbie
 
DaveQB's Avatar
 
Join Date: Apr 2006
Location: Sydney
Posts: 14
Rep Power: 0 DaveQB is on a distinguished road
Send a message via ICQ to DaveQB Send a message via Skype™ to DaveQB
Quote:
Originally Posted by Lich
1) Try to use POST and not GET variables so you don't throw things in the URL
Ahh thanx for that. I was wondering how I could work around that.

Quote:
Originally Posted by Lich
2) Why would you use a backend code as a frontend to call a different backend?
Well what other options is there ?? I have used that before, used PHP to execute the script, passing it a var or 2 and using the result to determine what page to present and fill in the data. Simple stuff.
I guess I just want a way to use Python rather then PHP.
DaveQB is offline   Reply With Quote
Old May 12th, 2006, 5:31 PM   #8
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
You should check out one of the python web developement frameworks like Zope , Django, or TurboGears.
Game_Ender is offline   Reply With Quote
Old May 12th, 2006, 6:17 PM   #9
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4 Arevos is on a distinguished road
DaveQB seems to be limited by his hosting company. If CherryPy and mod_python are out of the question, then Zope, Django and Turbogears certainly are.
Arevos is offline   Reply With Quote
Old May 12th, 2006, 10:11 PM   #10
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 927
Rep Power: 4 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by Lich
Try to use POST and not GET variables so you don't throw things in the URL
While I agree in general, in some cases, you might want the user-sibmitted data to be part of the URL, such as for search page results, as this allows the user to cut-and-paste the URL with ease, bookmark the page without the server needing to store a cookie, etc. I'm not saying this to start a debate, but rather to show the OP that there are cases where one method is more appropriate.

Obviously, with data that expires, or is sensitive, you want to use POST, as you suggest. POST is also necessary if the length of the extra data exceeds environment limits.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp
lectricpharaoh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:40 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC