By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,100 Members | 2,892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,100 IT Pros & Developers. It's quick & easy.

python web programming / CMS

P: n/a
Hi,

i'm looking at python to do programming for the new intranet
here at the company. I'm looking at plone/zope also.
Before, I've used jsp for webprogramming but i'm considering
python for this.
One thing that isn't clear to me is if it's possible to include python
code in a html page like you would do with jsp and then have zope
"translate" that to html. With jsp, one could use an apache/tomcat
combo to accomplish this.
If one can't include python in html, is Zope the only alternative and
how does code look like then?

Thanks
Jul 18 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
news.telenet.be wrote:
Hi,

i'm looking at python to do programming for the new intranet
here at the company. I'm looking at plone/zope also.
Before, I've used jsp for webprogramming but i'm considering
python for this.
One thing that isn't clear to me is if it's possible to include python
code in a html page like you would do with jsp and then have zope
"translate" that to html. With jsp, one could use an apache/tomcat
combo to accomplish this.
If one can't include python in html, is Zope the only alternative and
how does code look like then?

Thanks

There are various ways to implement a "PSP (Python Server Pages)"-type
setup.

I don't know how well regarded it is amongst other python users - in
fact, I'd be interested to know, but I use the
very lightweight Spyce : http://spyce.sourceforge.net.

I use Spyce-flavoured apache, in combination with python cgi stuff to
great effect on our intranet.

Hope this helps.

Jul 18 '05 #2

P: n/a
"Arcane" <ar****@deepfort.com> schreef in bericht
news:ma**************************************@pyth on.org...
news.telenet.be wrote:
Hi,

i'm looking at python to do programming for the new intranet
here at the company. I'm looking at plone/zope also.
Before, I've used jsp for webprogramming but i'm considering
python for this.
One thing that isn't clear to me is if it's possible to include python
code in a html page like you would do with jsp and then have zope
"translate" that to html. With jsp, one could use an apache/tomcat
combo to accomplish this.
If one can't include python in html, is Zope the only alternative and
how does code look like then?

Thanks

There are various ways to implement a "PSP (Python Server Pages)"-type
setup.

I don't know how well regarded it is amongst other python users - in
fact, I'd be interested to know, but I use the
very lightweight Spyce : http://spyce.sourceforge.net.

I use Spyce-flavoured apache, in combination with python cgi stuff to
great effect on our intranet.

Hope this helps.


(saw name was misconfigured as news.telenet.be)

This seems to be doing what i want. However i have some more
questions :)

1. Am i correct in thinking i would have to add for instance FastCGI to
the Spyce install in order to get it working?

2. In jsp, i often used my own java objects in the code. Can you also do
this with Spyce? For instance, if i would have to get data from a db, i
would
make an object that implements code to do this and then create an instance
of that object in a PSP. Is this doable?

3. What databases can be accessed from Python?

Flupke

Jul 18 '05 #3

P: n/a
news.telenet.be wrote:
Hi,

i'm looking at python to do programming for the new intranet
here at the company. I'm looking at plone/zope also.
Before, I've used jsp for webprogramming but i'm considering
python for this.
One thing that isn't clear to me is if it's possible to include python
code in a html page like you would do with jsp and then have zope
"translate" that to html. With jsp, one could use an apache/tomcat
combo to accomplish this.
If one can't include python in html, is Zope the only alternative and
how does code look like then?

Thanks

Check out http://www.python.org/cgi-bin/moinmoin/WebProgramming
for all the python options.
I'd recommend checking out mod_python. You can embed Python in HTML
using mod_python's PSP.
Jul 18 '05 #4

P: n/a
In article <EO********************@phobos.telenet-ops.be>, news.telenet.be wrote:
Hi,

i'm looking at python to do programming for the new intranet
here at the company. I'm looking at plone/zope also.
Before, I've used jsp for webprogramming but i'm considering
python for this.
One thing that isn't clear to me is if it's possible to include python
code in a html page like you would do with jsp and then have zope
"translate" that to html. With jsp, one could use an apache/tomcat
combo to accomplish this.
Look at PSP. See www.modpython.org for mor information.
If one can't include python in html, is Zope the only alternative and
how does code look like then?


By no means. For more info start here: http://www.python.org/sigs/web-sig/

Hth,

PterK
--
Peter van Kampen
pterk -- at -- datatailors.com
Jul 18 '05 #5

P: n/a
> 1. Am i correct in thinking i would have to add for instance FastCGI to
the Spyce install in order to get it working?

2. In jsp, i often used my own java objects in the code. Can you also do
this with Spyce? For instance, if i would have to get data from a db, i
would
make an object that implements code to do this and then create an instance
of that object in a PSP. Is this doable?

3. What databases can be accessed from Python?


i've only played a bit with Spyce.

you can use it as plain CGI, or you can use FastCGI or modpython. your
choice.

you can invoke python scripts which can make database connections.

database support isn't built into Spyce. you get the python-wrapper for
whatever database you want. a bunch are available. certainly all the
major databases.

modpython has recently greatly expanded its scope. now it includes PSP
style functionality. also session support. seems to overlap pretty
heavily/maybe subsume what Spyce does.

i tried asking on the modpython group for a comparison of modpython PSP
v. Spyce PSP, especially in terms on completeness, stability, scope, etc.

i triggered an interesting discussion of PSP-style templates, but no one
directly answered my question.

Be advised also there are other python PSP-style projects out there,
including one named PSP.

Also I hope you realize none of these projects are a CMS framework of
any sort. They are tools with which you could write your own.

I assume your CMS requirements are very minimal or you would avoid
trying to reinvent the wheel.
Jul 18 '05 #6

P: n/a
asdf sdf wrote:

i've only played a bit with Spyce.

you can use it as plain CGI, or you can use FastCGI or modpython.
your choice.

you can invoke python scripts which can make database connections.

database support isn't built into Spyce. you get the python-wrapper
for whatever database you want. a bunch are available. certainly
all the major databases.

modpython has recently greatly expanded its scope. now it includes
PSP style functionality. also session support. seems to overlap
pretty heavily/maybe subsume what Spyce does.

i tried asking on the modpython group for a comparison of modpython
PSP v. Spyce PSP, especially in terms on completeness, stability,
scope, etc.

i triggered an interesting discussion of PSP-style templates, but no
one directly answered my question.

Be advised also there are other python PSP-style projects out there,
including one named PSP.

Also I hope you realize none of these projects are a CMS framework of
any sort. They are tools with which you could write your own.

I assume your CMS requirements are very minimal or you would avoid
trying to reinvent the wheel.


Well, i'm assigned a project where i have to choose a intranet sollution
and a platform for future webbased tools development.
I'm trying to get a clear idea of what is possible.
For the moment 2 kinds of setup are considered
OpenCMS - JBoss - Apache - Tomcat
or
Plone - Zope - Apache - Spyce / modpython

A have worked with jsp's before so i pretty much know what i could
except from the first environment. But python triggered my interest
because it's faster to develop code (and clean code) and Plone
seems like one of the best opensource CMS around.

I know that with OpenCMS, i could make html pages with jsp
code inside. Is that also possible in Plone/Zope? I mean having plone
process pages with embedded Python through modpython or Spyce?
Or is plone going to send the pages to Zope? That's a part that's not
yet clear for me.

Also, can one use his own python objects in those PSP pages?

flupke
Jul 18 '05 #7

P: n/a
> Well, i'm assigned a project where i have to choose a intranet sollution
and a platform for future webbased tools development.
I'm trying to get a clear idea of what is possible.
For the moment 2 kinds of setup are considered
OpenCMS - JBoss - Apache - Tomcat
or
Plone - Zope - Apache - Spyce / modpython


with modpython/spyce you can use your own python objects.

There's been a lot of discussion of Plone and Zope. Check Slashdot.
Both have a lot of rapid fans, but naysayers say they are too
complicated and too slow. Some say you're buy end user ease-of-use at
the cost of administrative complexity. you'll have to let me know what
you find out.

Jul 18 '05 #8

P: n/a
asdf sdf wrote:
Well, i'm assigned a project where i have to choose a intranet
sollution and a platform for future webbased tools development.
I'm trying to get a clear idea of what is possible.
For the moment 2 kinds of setup are considered
OpenCMS - JBoss - Apache - Tomcat
or
Plone - Zope - Apache - Spyce / modpython


with modpython/spyce you can use your own python objects.

There's been a lot of discussion of Plone and Zope. Check Slashdot.
Both have a lot of rapid fans, but naysayers say they are too
complicated and too slow. Some say you're buy end user ease-of-use at
the cost of administrative complexity. you'll have to let me know
what you find out.


Hehe :) Well i'm trying to figure out before i decide on what i'm
going to use. Are there other good CMS around based on Python?

Anyway, i saw a page ( forgot the link ) that had benchmarks
between python, java, c++ and perl and it seemed that Python
was indeed a lot slower than the other languages. But if you have
a fast server, it might not be so much of a problem.

flupke

Jul 18 '05 #9

P: n/a
Hehe :) Well i'm trying to figure out before i decide on what i'm
going to use. Are there other good CMS around based on Python?

Anyway, i saw a page ( forgot the link ) that had benchmarks
between python, java, c++ and perl and it seemed that Python
was indeed a lot slower than the other languages. But if you have
a fast server, it might not be so much of a problem.

flupke

Check out the earlier thread 'Simple pyhon-based CMS' (sic) started on
4-13 by Stewart Midwinter in this group.

many threads in this group have clearly established that python is just
as fast as java, c, c++, perl, assembler and light, and that speed
doesn't matter anyways ;)

Jul 18 '05 #10

P: n/a
"flupke" <fl****@nonexistingdomain.com> writes:
I know that with OpenCMS, i could make html pages with jsp
code inside. Is that also possible in Plone/Zope? I mean having plone
process pages with embedded Python through modpython or Spyce?
Er. I'm not sure that really makes sense.
Or is plone going to send the pages to Zope?
Or that :-)
That's a part that's not yet clear for me.


You can certainly do dynamic content with Zope/Plone, using Page
Templates and TAL and Scripts (Python) and so on (indeed, quite a
large portion of Plone is a collection of Page Templates and Python
scripts). It's probably possible to use Plone and Spyce at the same
time, but I can't see why you'd want to.

Cheers,
mwh
PS: Page Templates rule.

--
I think if we have the choice, I'd rather we didn't explicitly put
flaws in the reST syntax for the sole purpose of not insulting the
almighty. -- /will on the doc-sig
Jul 18 '05 #11

P: n/a
"Michael Hudson" <mw*@python.net> schreef in bericht
news:m3************@pc150.maths.bris.ac.uk...
You can certainly do dynamic content with Zope/Plone, using Page
Templates and TAL and Scripts (Python) and so on (indeed, quite a
large portion of Plone is a collection of Page Templates and Python
scripts). It's probably possible to use Plone and Spyce at the same
time, but I can't see why you'd want to.


The reason why i would want to use Plone and Spyce is that Spyce
provides an easy way to include/embed python code in a html file like
one would do with a jsp page.
I don't think that Plone supports something like that or at least not
that nice but i could be wrong.

flupke
Jul 18 '05 #12

P: n/a
"flupke" <fl****@nonexistingdomain.com> writes:
"Michael Hudson" <mw*@python.net> schreef in bericht
news:m3************@pc150.maths.bris.ac.uk...
You can certainly do dynamic content with Zope/Plone, using Page
Templates and TAL and Scripts (Python) and so on (indeed, quite a
large portion of Plone is a collection of Page Templates and Python
scripts). It's probably possible to use Plone and Spyce at the same
time, but I can't see why you'd want to.


The reason why i would want to use Plone and Spyce is that Spyce
provides an easy way to include/embed python code in a html file like
one would do with a jsp page.
I don't think that Plone supports something like that or at least not
that nice but i could be wrong.


That's what Page Templates are! Ish. Well, Page Templates solve the
same problem, though you're encouraged to put significant logic in
Python scripts which you call from the template. I happen to agree
with the designers of Page Templates that this is a very good idea; I
guess others might differ.

Cheers,
mwh

--
I have long since given up dealing with people who hold idiotic
opinions as if they had arrived at them through thinking about
them. -- Erik Naggum, comp.lang.lisp
Jul 18 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.