Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Login Script

Reply
Thread Tools

Login Script

 
 
Simon Faulkner
Guest
Posts: n/a
 
      06-28-2003
I have written a small Python web database which was initially just
used in house.

Now we want people to be able to read some pages from outside so I
need to implement some sort of security.

Does Python have sessions like PHP?

If not should I roll my own from a cookie and a MySQL table?

Any advice...


Simon
(PS I know that I should probably be using Zope but I don't really
understand it yet...)
 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?Gerhard_H=E4ring?=
Guest
Posts: n/a
 
      06-28-2003
Simon Faulkner wrote:
> I have written a small Python web database which was initially just
> used in house.


Is this a CGI-based solution?

> Now we want people to be able to read some pages from outside so I
> need to implement some sort of security.
>
> Does Python have sessions like PHP?


The cgi module doesn't include anything for sessions, but there are tons
of third-party solutions for sessions.

All Python web frameworks should have integrated support for sessions.
I'm right now using Quixote to create a web frontend for a custom
PostgreSQL-backed hosting solution I've developed. It needs sessions,
because each user can configure her or his mailboxes and HTTP domains.

> If not should I roll my own from a cookie and a MySQL table?


Ouch, MySQL. Sounds like you're using CGI as well

> Any advice...


The quick solution is to grab an existing standalone session module. I
believe you could use the one from Jonpy. Rolling your own with Cookies
and a persistent database isn't that hard either.

My advice is that if you plan to do more web development with Python,
that you start using a web framework. Perhaps Jonpy is a good candidate
for you (http://jonpy.sourceforge.net/).

Here's an overwhelming resource for web programming solutions for
Python: http://www.python.org/cgi-bin/moinmoin/WebProgramming

These seem to be particularly popular: Albatross, Webware, Quixote,
Jonpy. All of them can work with standalone CGI scripts as well.

> Simon
> (PS I know that I should probably be using Zope but I don't really
> understand it yet...)


Nah. You don't need to use something as complex as ZOPE to get sessions.
Nor do you need to use something as primitive as the cgi module. There
are lots of solutions which are in-between in complexity and features.

-- Gerhard

 
Reply With Quote
 
 
 
 
Simon Faulkner
Guest
Posts: n/a
 
      06-28-2003
Big thanks for this comprehensive reply.

I am well versed with MySQL so that's my backend.

Any particular favorites for a front end?

Simon
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute a script from another script and other script does notdo busy wait. Rajat Python 3 01-08-2010 02:05 PM
RE: How to execute a script from another script and other script doesnotdo busy wait. VYAS ASHISH M-NTB837 Python 2 01-07-2010 08:18 PM
News login different from mail login William W. Plummer Firefox 21 04-08-2005 05:37 AM
Forms Login Page Not Login Out Hermit Dave ASP .Net 5 01-13-2004 07:14 AM
Re: PLEASE? Any way to get the user's nt login from the pc -- not the server login? William F. Robertson, Jr. ASP .Net 0 07-02-2003 03:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57