473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Login Script

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...)
Jul 18 '05 #1
2 8486
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 :-P
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

Jul 18 '05 #2
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
Jul 18 '05 #3

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

Similar topics

3
by: koolyio | last post by:
Hey, could you please tell me what is wrong with my login script. I just started learning php. CODE: login.php <? session_start(); header("Cache-Control: private"); ?>
0
by: John Meyer | last post by:
index: <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <!DOCTYPE html PUBLIC...
1
by: pj | last post by:
I'm trying to redirect users to another page after they Authenticate with the ASP.NET login controls. The user is able to login, but I can't get the response.redirect to work. Can anyone help? ...
3
by: bull1099 | last post by:
I designed a simple site which has a login for users to access their account page. When i had my files uploaded on a terrible hosting service site, my website I designed was fully functional. I moved...
0
by: kang jia | last post by:
hi i am currently learning Django framework and i have to do a login page at the moment. i have used the code like following: from django.contrib.auth import authenticate, login def...
14
victorduwon
by: victorduwon | last post by:
Hi guys and gals, I am using javascript to autologin to my google analytics account via a hyperlink. This is what the text looks like this <?xml version="1.0" encoding="utf-8"?>...
3
by: satishknight | last post by:
Hi, Can some one tell me how to change the validation sequence for the code pasted below, actually what I want it when any one enters the wrong login information (already registered users) then it...
10
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey...
9
by: adweaver | last post by:
Hello All, I'm new to the world of php. I've just had a site designed for me by a company, and I'm now trying to manage and grow it, so it will suit my needs. The site was built in a folder...
21
by: tvnaidu | last post by:
This is the Java script I am using fo rlogin page, but cursor not pointing to login box, any idea how can I point cursor to login box when this page loaded?. here admin login take to control page and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.