473,657 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Easy web session module with Python?

Hi, I'm looking for an easy way to do web development with Python
(session handling a-la ASP/JSP/PHP, that kind of thing). I've looked at
PythonWeb.org but it has bugs because it's not tested on UNIX platforms
it seems (I've created some patches and sent them to the author), and a
quick browse through PyPI in the mature/stable packages doesn't reveal
much hope, unless I've missed something. I've googled for session
handling with Python, and it seems something called "pso" would be ok,
but that is only mod_python as far as I know, and I may need something
that works with cgi only hosts.

I could write my own I suppose, but surely someone has done this before?
Thanks for any tips!

Johnathan
Jul 18 '05 #1
6 3049
Am Thu, 14 Oct 2004 13:50:09 +1000 schrieb Johnathan Doe:
Hi, I'm looking for an easy way to do web development with Python
(session handling a-la ASP/JSP/PHP, that kind of thing). I've looked at
PythonWeb.org but it has bugs because it's not tested on UNIX platforms
it seems (I've created some patches and sent them to the author), and a
quick browse through PyPI in the mature/stable packages doesn't reveal
much hope, unless I've missed something. I've googled for session
handling with Python, and it seems something called "pso" would be ok,
but that is only mod_python as far as I know, and I may need something
that works with cgi only hosts.


Hi,

You can use quixote. Use SessionPublishe r. You need
a mapping to store the data. A very simple but useable mapping
is DirMapping which is in session_demo.cg i.

This should work with every webserver, even with CGIHTTPServer from the
standard library.

HTH,
Thomas

Jul 18 '05 #2
Johnathan Doe wrote:
I could write my own I suppose, but surely someone has done this before?


Session management is usually delivered as part of the
application server. Zope, Webware, CherryPy, Quixote,
Snakelets all have session management integrated into
them.

Standalone session modules are probably less used
nowadays, here is one

http://jonpy.sourceforge.net/session.html

Istvan.
Jul 18 '05 #3
[Johnathan Doe]
Hi, I'm looking for an easy way to do web development with Python
(session handling a-la ASP/JSP/PHP, that kind of thing). I've looked at
PythonWeb.org but it has bugs because it's not tested on UNIX platforms
it seems (I've created some patches and sent them to the author), and a
quick browse through PyPI in the mature/stable packages doesn't reveal
much hope, unless I've missed something. I've googled for session
handling with Python, and it seems something called "pso" would be ok,
but that is only mod_python as far as I know, and I may need something
that works with cgi only hosts.
Ah, the perennial problems with python web software. You find something
that is close to what you need, but it doesn't work on the platform or
server you want, or it is so deeply embedded in some given framework
that it not reusable outside that framework without a total rewrite.
I could write my own I suppose, but surely someone has done this before?
Yes, this particular wheel has been reinvented before, again and again
and again and ..........
Thanks for any tips!


There is a new python web standard called WSGI that seeks to refactor
out these kinds of reusable components and make them portable not just
between servers but also between frameworks. WSGI refers to these as
"middleware components".

http://www.python.org/peps/pep-0333.html

Although WSGI is still a standard in formation, I recommend that you at
least take a look at it: by starting down a standardised road, you will
at least have a chance to reuse other peoples components.

I know of only one WSGI-compliant session module: the one written by Ian
Bicking, principal author of WebWare. It is not fully released yet, i.e.
it is only available from Ian's Subversion source code repository. You
can find out how to access that here

http://mail.python.org/pipermail/web...er/000941.html

HTH,

--
alan kennedy
------------------------------------------------------
email alan: http://xhaus.com/contact/alan
Jul 18 '05 #4
Thanks guys for your replies! That was really helpful. Looks like I
need a bit more time to study everything available for Python. You
know, I wonder why Python doesn't have more "native" web development
infrastructure like PHP. I think (abviously so do zillions of others)
that Python is a beautiful and usable language, and I reckon that this
issue of some kind of standard web dev module is holding back its
popularity. It could be at least a few orders of magnitude more popular
than PHP if it was heavy in web development infrastructure.

Cheers
Johnathan
Jul 18 '05 #5
Am Fri, 15 Oct 2004 18:57:11 +1000 schrieb Johnathan Doe:
Thanks guys for your replies! That was really helpful. Looks like I
need a bit more time to study everything available for Python. You
know, I wonder why Python doesn't have more "native" web development
infrastructure like PHP. I think (abviously so do zillions of others)
that Python is a beautiful and usable language, and I reckon that this
issue of some kind of standard web dev module is holding back its
popularity. It could be at least a few orders of magnitude more popular
than PHP if it was heavy in web development infrastructure.

Hi,

Yes, it would be nice if there was *one* standard way.
Quixote is very small and simple. Other libraries could
be build on top of it, using the simple API.

Thomas

Jul 18 '05 #6
If you are looking for something like ASP/JSP/PHP be sure to look at
Spyce. Spyce (Python Server Pages - PSP) embeds Python in HTML.

http://spyce.sourceforge.net

Johnathan Doe wrote:
Hi, I'm looking for an easy way to do web development with Python
(session handling a-la ASP/JSP/PHP, that kind of thing). I've looked at
PythonWeb.org but it has bugs because it's not tested on UNIX platforms
it seems (I've created some patches and sent them to the author), and a
quick browse through PyPI in the mature/stable packages doesn't reveal
much hope, unless I've missed something. I've googled for session
handling with Python, and it seems something called "pso" would be ok,
but that is only mod_python as far as I know, and I may need something
that works with cgi only hosts.

I could write my own I suppose, but surely someone has done this before?
Thanks for any tips!

Johnathan

Jul 18 '05 #7

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

Similar topics

33
9155
by: Jim Hill | last post by:
I've done some Googling around on this and it seems like creating a here document is a bit tricky with Python. Trivial via triple-quoted strings if there's no need for variable interpolation but requiring a long, long formatted arglist via (%s,%s,%s,ad infinitum) if there is. So my question is: Is there a way to produce a very long multiline string of output with variables' values inserted without having to resort to this wacky """v...
3
3579
by: Erik Johnson | last post by:
There are a lot of things about PHP I was not too keen on and hence why my company is primarily doing Python these days, but one thing I was quite impressed with was the ease with which it provided session functionality... <?php session_start(); session_register; $my_var = "whatever";
5
5678
by: Sullivan WxPyQtKinter | last post by:
Python disappointly failed to provide a convinient cgi session management module. Not willing to use external modules, I would like to implement a simplest Session object on my own. The basic problem is: how could a python CGI program understand several requests are in the same session? Definately, request from different IP would be easy to identified to be in different sessions, but request from the same IP would not. Anyone has any...
9
4161
by: Sullivan WxPyQtKinter | last post by:
I do not want to use Cookies in my site since not all web browser support it well and sometimes people close cookie functioning for security reasons. I tried to add hidden field with a sessionID in every python CGI script generated web pages, so everytime my client POST a request, the server will retrieve the sessionID and decide if it is in the same session. However, since python cgi do not have a function for redirecting to a page, I...
2
2173
by: Adam Blinkinsop | last post by:
I'm writing a set of modules to monitor remote system services, and I'm having a problem running my test scripts. When I pass the scripts into python, like so: -- $ PYTHONPATH="${TARGET_DIR}" python test.py -- I get an ImportError:
8
7524
by: zdp | last post by:
Hello! I need to process some webpages of a forum which is powered by discuz!. When I login, there are some options about how long to keep the cookies: forever, month, week, et al. If I choose forever, I don't need to login each time, and When I open the internet explorer I can access any pages directly. Some urls of the pages like: http://www.somesite.com/bbs/viewthread.php?tid=12345&extra=page%3D1
3
1270
by: Jonathan Mark | last post by:
Some languages, such as Scheme, permit you to make a transcript of an interactive console session. Is there a way to do that in Python?
2
2690
by: Dr. Colombes | last post by:
Is there an easy scientific graphics (plotting) package for Python 2.5.1 running on Ubuntu Linux 7.1 ("Gutsy Gibbon")? A few years ago I used PyLab (a MatLab-like plotting module for Python) on a Windows machine, but I don't know if there is a similar easy-to-install-and-use Python 2.5.1-compatible graphics package for Ubuntu Linux 7.1? Thanks for any suggestions.
0
1899
by: Rafe | last post by:
Hi, This seems to be an old question, and I've read back a bit, but rather than assume the answer is "you can't do that", I'd thought I'd post my version of the question along with a reproducible error to illustrate my confusion. My problem is that I'm using Python inside XSI (a 3D graphics application). If I want to restart Python, I have to restart XSI. This is no small amount of time wasted.
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
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...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
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
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
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.