Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Web development with Python 3.1

 

 

First page Previous page 1 2 3 4 Next page Last page  View All Python python RSS feed   Index | Next | Previous | View Threaded


alan at baselinedata

Oct 25, 2009, 4:52 PM

Post #1 of 96 (893 views)
Permalink
Web development with Python 3.1

I am very much new to Python, and one of my first projects is a simple
data-based website. I am starting with Python 3.1 (I can hear many of
you shouting "don't - start with 2.6"), but as far as I can see, none of
the popular python-to-web frameworks (Django, CherryPy, web.py, etc.)
are Python3 compatible yet.

So, what can I use to start my web programming experience using 3.1?

Any help would be appreciated.

Alan

--
http://mail.python.org/mailman/listinfo/python-list


http://phr.cx at NOSPAM

Oct 25, 2009, 5:41 PM

Post #2 of 96 (860 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

Alan Harris-Reid <alan [at] baselinedata> writes:
> I am very much new to Python, and one of my first projects is a simple
> data-based website. I am starting with Python 3.1 (I can hear many of
> you shouting "don't - start with 2.6"), but as far as I can see, none
> of the popular python-to-web frameworks (Django, CherryPy, web.py,
> etc.) are Python3 compatible yet.
>
> So, what can I use to start my web programming experience using 3.1?

Does it occur to you that the unavailability of those frameworks is
part of the REASON they say to use 2.x? Have you answered your own
question?

Anyway, for simple web programming, frameworks are not worth the
hassle. Just use the cgi module.

If you want to use a framework, well, you are the one who decided to
zoom off into the 3.1 wilderness before the framework developers got
there. If you're an experienced programmer in other languages and
you're determined to use a framework, maybe a worthwhile Python
learning project would be to help port your favorite framework to 3.1.
--
http://mail.python.org/mailman/listinfo/python-list


exarkun at twistedmatrix

Oct 25, 2009, 5:56 PM

Post #3 of 96 (861 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

On 25 Oct, 11:52 pm, alan [at] baselinedata wrote:
>
>I am very much new to Python, and one of my first projects is a simple
>data-based website. I am starting with Python 3.1 (I can hear many of
>you shouting "don't - start with 2.6"), but as far as I can see, none
>of the popular python-to-web frameworks (Django, CherryPy, web.py,
>etc.) are Python3 compatible yet.
>
>So, what can I use to start my web programming experience using 3.1?
>
>Any help would be appreciated.

don't - start with 2.6
>Alan
>
>--
>http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list


brendon.wickham at gmail

Oct 25, 2009, 6:09 PM

Post #4 of 96 (860 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

>
> Anyway, for simple web programming, frameworks are not worth the
> hassle. Just use the cgi module.
>
>
I can vouch for what Paul says. I started in Python 3 years ago, and I did
so with a web application (still working on it!). I'm using the cgi
approach, and it certainly teaches you the concepts. I fail to see how
starting with a framework is a good idea if you don't know how the
frameworks work (or what they're actually doing). It would be a bit like
doing a web page in Dreamw***er and thinking you understand HTML/CSS.

B


chris at simplistix

Oct 26, 2009, 4:24 AM

Post #5 of 96 (852 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

Brendon Wickham wrote:
> I can vouch for what Paul says. I started in Python 3 years ago, and I
> did so with a web application (still working on it!). I'm using the cgi
> approach, and it certainly teaches you the concepts. I fail to see how
> starting with a framework is a good idea if you don't know how the
> frameworks work (or what they're actually doing). It would be a bit like
> doing a web page in Dreamw***er and thinking you understand HTML/CSS.

I couldn't agree less. Using the CGI module is more akin to trying to
write Dreamweaver when you want to build a static website...

Just use 2.6 and pick a framework of your choice. From what the OP
described, Django or Pylons would fit the bill well.

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list


oshecho at gmail

Oct 26, 2009, 7:16 AM

Post #6 of 96 (840 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

bottle (http://bottle.paws.de/) can run on python 3.1 after running
the 2to3 tool on it. It is a very lightweight framework. CherryPy 3.2
also runs on python 3.x

I don't know if there are any others.

On Sun, Oct 25, 2009 at 7:52 PM, Alan Harris-Reid
<alan [at] baselinedata> wrote:
>
> I am very much new to Python, and one of my first projects is a simple
> data-based website. I am starting with Python 3.1 (I can hear many of you
> shouting "don't - start with 2.6"), but as far as I can see, none of the
> popular python-to-web frameworks (Django, CherryPy, web.py, etc.) are
> Python3 compatible yet.
>
> So, what can I use to start my web programming experience using 3.1?
>
> Any help would be appreciated.
>
> Alan
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



--
-Brandon Singer
--
http://mail.python.org/mailman/listinfo/python-list


alan at baselinedata

Oct 26, 2009, 5:56 PM

Post #7 of 96 (838 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

Hi Paul, thanks for the reply (despite the sarcasm ;-) ),

>Does it occur to you that the unavailability of those frameworks is
part of the REASON they say to use 2.x?
Of course, but that doesn't mean that there isn't someone out there who
may know of a framework that is already Python3 compatible, or is being
worked-on.

>Have you answered your own question?
No

>Anyway, for simple web programming, frameworks are not worth the
hassle. Just use the cgi module.
Ok - I'll look into it.

>... you are the one who decided to zoom off into the 3.1 wilderness
before the framework developers got there.
I haven't zoomed-off anywhere yet - in fact I've hardly started. I made
the decision to start with 3.1 based on the fact that it was the latest
version, and hoping that there may be some framework stuff out there
(because 3.0 has been out for a while now). However, it looks as though
I might have to review that decision, but what I've learned so far is
pretty simple stuff, so it won't be wasted.

Regards,
Alan
> Alan Harris-Reid <alan [at] baselinedata> writes:
>
>> I am very much new to Python, and one of my first projects is a simple
>> data-based website. I am starting with Python 3.1 (I can hear many of
>> you shouting "don't - start with 2.6"), but as far as I can see, none
>> of the popular python-to-web frameworks (Django, CherryPy, web.py,
>> etc.) are Python3 compatible yet.
>>
>> So, what can I use to start my web programming experience using 3.1?
>>
>
> Does it occur to you that the unavailability of those frameworks is
> part of the REASON they say to use 2.x? Have you answered your own
> question?
>
> Anyway, for simple web programming, frameworks are not worth the
> hassle. Just use the cgi module.
>
> If you want to use a framework, well, you are the one who decided to
> zoom off into the 3.1 wilderness before the framework developers got
> there. If you're an experienced programmer in other languages and
> you're determined to use a framework, maybe a worthwhile Python
> learning project would be to help port your favorite framework to 3.1.


alan at baselinedata

Oct 26, 2009, 6:06 PM

Post #8 of 96 (834 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

Exarkun - thanks for the reply

> don't - start with 2.6
Thought you might say that ;-)

Regards,
Alan

On 25 Oct, 11:52 pm, alan [at] baselinedata wrote:
>
>I am very much new to Python, and one of my first projects is a simple
>data-based website. I am starting with Python 3.1 (I can hear many of
>you shouting "don't - start with 2.6"), but as far as I can see, none
>of the popular python-to-web frameworks (Django, CherryPy, web.py,
>etc.) are Python3 compatible yet.
>
>So, what can I use to start my web programming experience using 3.1?
>
>Any help would be appreciated.

don't - start with 2.6
>Alan
>
>--
>http://mail.python.org/mailman/listinfo/python-list
Attachments: Attached Message Part (0.16 KB)


alan at baselinedata

Oct 26, 2009, 6:10 PM

Post #9 of 96 (835 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

>
> Anyway, for simple web programming, frameworks are not worth the
> hassle. Just use the cgi module.
>
>
> I can vouch for what Paul says. I started in Python 3 years ago, and I
> did so with a web application (still working on it!). I'm using the
> cgi approach, and it certainly teaches you the concepts. I fail to see
> how starting with a framework is a good idea if you don't know how the
> frameworks work (or what they're actually doing). It would be a bit
> like doing a web page in Dreamw***er and thinking you understand
> HTML/CSS.
>
> B
>
Hi Brendon, thanks for the advice. Looks like I'll have to go the cgi
route myself if I want to stick with with Python3.

Regards,
Alan


aaron.watters at gmail

Oct 26, 2009, 8:04 PM

Post #10 of 96 (830 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

On Oct 25, 7:52 pm, Alan Harris-Reid <a...@baselinedata.co.uk> wrote:
> I am very much new to Python, and one of my first projects is a simple
> data-based website. I am starting with Python 3.1 (I can hear many of
> you shouting "don't - start with 2.6"), but as far as I can see, none of
> the popular python-to-web frameworks (Django, CherryPy, web.py, etc.)
> are Python3 compatible yet.
>
> So, what can I use to start my web programming experience using 3.1?
>
> Any help would be appreciated.
>
> Alan

Don't. use python 2.6 with WHIFF :)
http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index
http://whiff.sourceforge.net

-- Aaron Watters

===
It gotta be rock-roll music
if you wanna dance with me
if you wanna dance with me
--
http://mail.python.org/mailman/listinfo/python-list


alan at baselinedata

Oct 27, 2009, 4:08 AM

Post #11 of 96 (815 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

Aaron Watters wrote:
> On Oct 25, 7:52 pm, Alan Harris-Reid <a...@baselinedata.co.uk> wrote:
>
>> I am very much new to Python, and one of my first projects is a simple
>> data-based website. I am starting with Python 3.1 (I can hear many of
>> you shouting "don't - start with 2.6"), but as far as I can see, none of
>> the popular python-to-web frameworks (Django, CherryPy, web.py, etc.)
>> are Python3 compatible yet.
>>
>> So, what can I use to start my web programming experience using 3.1?
>>
>> Any help would be appreciated.
>>
>> Alan
>>
>
> Don't. use python 2.6 with WHIFF :)
> http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index
> http://whiff.sourceforge.net
>
> -- Aaron Watters
Thanks for the advice

Alan


billy.earney at gmail

Oct 27, 2009, 5:24 AM

Post #12 of 96 (810 views)
Permalink
RE: Web development with Python 3.1 [In reply to]

I would agree with Alan. Most of the libraries you should use are
compatible with the 2.x series.. I still use versions 2.5 and 2.6 for all
development.



From: python-list-bounces+billy.earney=gmail.com [at] python
[mailto:python-list-bounces+billy.earney=gmail.com [at] python] On Behalf Of
Alan Harris-Reid
Sent: Tuesday, October 27, 2009 6:08 AM
To: Python List
Subject: Re: Web development with Python 3.1



Aaron Watters wrote:

On Oct 25, 7:52 pm, Alan Harris-Reid <mailto:a...@baselinedata.co.uk>
<a...@baselinedata.co.uk> wrote:


I am very much new to Python, and one of my first projects is a simple
data-based website. I am starting with Python 3.1 (I can hear many of
you shouting "don't - start with 2.6"), but as far as I can see, none of
the popular python-to-web frameworks (Django, CherryPy, web.py, etc.)
are Python3 compatible yet.

So, what can I use to start my web programming experience using 3.1?

Any help would be appreciated.

Alan



Don't. use python 2.6 with WHIFF :)
http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index
http://whiff.sourceforge.net

-- Aaron Watters

Thanks for the advice

Alan


dotancohen at gmail

Oct 27, 2009, 7:17 AM

Post #13 of 96 (809 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

Why the push to use a framework, and why the resistance from the OP?

Does the OP need to work with cookies or other http-specific features?
In fact, other than cookies, what http-specific features exist? Does
Python have a built-in framework for making available GET and POST
variables? Database queries should be no different than in other
Python apps.


--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
--
http://mail.python.org/mailman/listinfo/python-list


deets at nospam

Oct 27, 2009, 7:26 AM

Post #14 of 96 (815 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

Dotan Cohen wrote:

> Why the push to use a framework, and why the resistance from the OP?
>
> Does the OP need to work with cookies or other http-specific features?
> In fact, other than cookies, what http-specific features exist?

declarative mapping of urls to code, of code to templates, abstracting away
the details of GET and POST, validating and decoding parameters, especially
if these become larger repetitive structures like several addresses of a
user, re-rendering invalid form-data, working with HTML or JSON as output,
managing transactions, providing a error-reporting-infrastructure

The list continues.


> Does
> Python have a built-in framework for making available GET and POST
> variables? Database queries should be no different than in other
> Python apps.

Yes, in the end of the day, it's all python.

Diez
--
http://mail.python.org/mailman/listinfo/python-list


martin at v

Oct 27, 2009, 11:34 AM

Post #15 of 96 (805 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

> I am very much new to Python, and one of my first projects is a simple
> data-based website. I am starting with Python 3.1 (I can hear many of
> you shouting "don't - start with 2.6"), but as far as I can see, none of
> the popular python-to-web frameworks (Django, CherryPy, web.py, etc.)
> are Python3 compatible yet.

That's not entirely true, see

http://wiki.python.org/moin/PortingDjangoTo3k

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list


martin at v

Oct 27, 2009, 11:34 AM

Post #16 of 96 (805 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

> I am very much new to Python, and one of my first projects is a simple
> data-based website. I am starting with Python 3.1 (I can hear many of
> you shouting "don't - start with 2.6"), but as far as I can see, none of
> the popular python-to-web frameworks (Django, CherryPy, web.py, etc.)
> are Python3 compatible yet.

That's not entirely true, see

http://wiki.python.org/moin/PortingDjangoTo3k

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list


dotancohen at gmail

Oct 27, 2009, 11:36 AM

Post #17 of 96 (808 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

> declarative mapping of urls to code

Apache does this, unless I am misunderstanding you.


> of code to templates

Those who code in HTML don't need this. In any case it's not hard to
call a function in a class that writes the HTML before the content,
then write the content, then call another function that writes the
HTML after the content. This is how my sites are run, though in PHP
instead of Python. No prepackaged templates.

> abstracting away
> the details of GET and POST

GET is easy, just parse the HTTP request. I don't know how much of a
problem POST would be.


> validating and decoding parameters, especially
> if these become larger repetitive structures like several addresses of a
> user

This falls under database, cookies, or HTTP request parsing. Or am I
misunderstanding something again?


> re-rendering invalid form-data

Just add it into the HTML.


> working with HTML or JSON as output,

Same as writing to stdout, just output the HTTP headers first.


> managing transactions, providing a error-reporting-infrastructure
>

This does not differ from regular (non-web) Python coding.


> The list continues.
>

I would really like to know what else. So far, I am not convinced that
a framework offers anything that is not already easily accomplished in
Python.

--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
--
http://mail.python.org/mailman/listinfo/python-list


debatem1 at gmail

Oct 27, 2009, 11:58 AM

Post #18 of 96 (815 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

On Tue, Oct 27, 2009 at 2:36 PM, Dotan Cohen <dotancohen [at] gmail> wrote:
>> declarative mapping of urls to code
>
> Apache does this, unless I am misunderstanding you.
>
>
>> of code to templates
>
> Those who code in HTML don't need this. In any case it's not hard to
> call a function in a class that writes the HTML before the content,
> then write the content, then call another function that writes the
> HTML after the content. This is how my sites are run, though in PHP
> instead of Python. No prepackaged templates.
>
>> abstracting away
>> the details of GET and POST
>
> GET is easy, just parse the HTTP request. I don't know how much of a
> problem POST would be.
>
>
>> validating and decoding parameters, especially
>> if these become larger repetitive structures like several addresses of a
>> user
>
> This falls under database, cookies, or HTTP request parsing. Or am I
> misunderstanding something again?
>
>
>> re-rendering invalid form-data
>
> Just add it into the HTML.
>
>
>> working with HTML or JSON as output,
>
> Same as writing to stdout, just output the HTTP headers first.
>
>
>> managing transactions, providing a error-reporting-infrastructure
>>
>
> This does not differ from regular (non-web) Python coding.
>
>
>> The list continues.
>>
>
> I would really like to know what else. So far, I am not convinced that
> a framework offers anything that is not already easily accomplished in
> Python.

Using a framework helps to ensure that your code is easy to maintain.
DRY isn't about saving time now, its about saving time six months
from now.

Geremy Condra
--
http://mail.python.org/mailman/listinfo/python-list


dotancohen at gmail

Oct 27, 2009, 12:11 PM

Post #19 of 96 (806 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

> Using a framework helps to ensure that your code is easy to maintain.

I see, that is a good point. With someone else (the framework
maintainers) worrying about maintaining function such as HTTP request
parsers, a lot of work won't have to be [re]done.


> DRY isn't about saving time now, its about saving time six months
> from now.
>

I suppose in this case it's DRTW (don't reinvent the wheel) but the
same principle applies.


--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
--
http://mail.python.org/mailman/listinfo/python-list


aaron.watters at gmail

Oct 27, 2009, 12:27 PM

Post #20 of 96 (805 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

On Oct 27, 10:26 am, "Diez B. Roggisch" <de...@nospam.web.de> wrote:
...
> Yes, in the end of the day, it's all python.

For me, in the end of the day, it's all java or PHP.
But I'm working on that. For my purposes the "frameworks"
don't really help much. That's why I built WHIFF :).

http://aaron.oirt.rutgers.edu/myapp/docs/W1100_2200.TreeView

-- Aaron Watters

===
If all you got is lemons, make lemonade.
-- anon.
--
http://mail.python.org/mailman/listinfo/python-list


debatem1 at gmail

Oct 27, 2009, 12:45 PM

Post #21 of 96 (806 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

On Tue, Oct 27, 2009 at 3:11 PM, Dotan Cohen <dotancohen [at] gmail> wrote:
>> Using a framework helps to ensure that your code is easy to maintain.
>
> I see, that is a good point. With someone else (the framework
> maintainers) worrying about maintaining function such as HTTP request
> parsers, a lot of work won't have to be [re]done.
>
>
>> DRY isn't about saving time now, its about saving time six months
>> from now.
>>
>
> I suppose in this case it's DRTW (don't reinvent the wheel) but the
> same principle applies.

Well, yes- but it's also DRY, and while DRTW (like the acronym, btw)
helps to prevent your code from being unreadable to someone else,
DRY helps to ensure that when you have to change something you
don't have to worry about changing it in 37 and a half other places
at the same time. Especially given how notoriously difficult it is to
do automated testing for web development, that's essential.

Geremy Condra
--
http://mail.python.org/mailman/listinfo/python-list


dotancohen at gmail

Oct 27, 2009, 1:52 PM

Post #22 of 96 (805 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

> Well, yes- but it's also DRY, and while DRTW (like the acronym, btw)
> helps to prevent your code from being unreadable to someone else,
> DRY helps to ensure that when you have to change something you
> don't have to worry about changing it in 37 and a half other places
> at the same time. Especially given how notoriously difficult it is to
> do automated testing for web development, that's essential.
>

That's what classes are for, no? Reuse code. I fail to see how using a
framework would reduce the need to use classes, provided that the need
exists.


--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
--
http://mail.python.org/mailman/listinfo/python-list


debatem1 at gmail

Oct 27, 2009, 2:34 PM

Post #23 of 96 (802 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

On Tue, Oct 27, 2009 at 4:52 PM, Dotan Cohen <dotancohen [at] gmail> wrote:
>> Well, yes- but it's also DRY, and while DRTW (like the acronym, btw)
>> helps to prevent your code from being unreadable to someone else,
>> DRY helps to ensure that when you have to change something you
>> don't have to worry about changing it in 37 and a half other places
>> at the same time. Especially given how notoriously difficult it is to
>> do automated testing for web development, that's essential.
>>
>
> That's what classes are for, no? Reuse code. I fail to see how using a
> framework would reduce the need to use classes, provided that the need
> exists.

...frameworks use classes. They just don't make you write all of them.

Geremy Condra
--
http://mail.python.org/mailman/listinfo/python-list


deets at nospam

Oct 27, 2009, 2:34 PM

Post #24 of 96 (803 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

Dotan Cohen schrieb:
>> Well, yes- but it's also DRY, and while DRTW (like the acronym, btw)
>> helps to prevent your code from being unreadable to someone else,
>> DRY helps to ensure that when you have to change something you
>> don't have to worry about changing it in 37 and a half other places
>> at the same time. Especially given how notoriously difficult it is to
>> do automated testing for web development, that's essential.
>>
>
> That's what classes are for, no? Reuse code. I fail to see how using a
> framework would reduce the need to use classes, provided that the need
> exists.
>

A webframework is *written* in python. Your whole line of argumentation
boils down to "I can write things myself in python, why use
libraries/frameworks". Yes. You can also delete your standard-lib, and
code everything in there yourself - with the same argument.

Using a framework is about proven solutions for common problems, letting
you focus on working on your actual application code.

Diez
--
http://mail.python.org/mailman/listinfo/python-list


nagle at animats

Oct 28, 2009, 12:08 AM

Post #25 of 96 (795 views)
Permalink
Re: Web development with Python 3.1 [In reply to]

Alan Harris-Reid wrote:
> I am very much new to Python, and one of my first projects is a simple
> data-based website. I am starting with Python 3.1

Until MySQLdb gets ported to something later than Python 2.5, support
for a "data-based web site" probably has to be in Python 2.5 or earlier.

The C module situation for Python 3.x still isn't very good.
Realistically, the production version of Python is 2.5. This process
is taking long enough that I'm worried that Python 3.x could do for
Python what Perl 6 did for Perl - provide an upgrade path that nobody
takes.

HTMLTemplate ("http://py-templates.sourceforge.net/htmltemplate/index.html")
is a minimal templating system for fill-in-the-blanks template work in Python.
Actually, if you have HTMLTemplate, FCGI, and MySQLdb, you have enough to
do a back-end database.

There are some advantages to libraries (you call them) over "frameworks"
(they call you) if you're doing something unusual. Frameworks are more
useful if you're doing yet another "Web 2.0" web site.

John Nagle
--
http://mail.python.org/mailman/listinfo/python-list

First page Previous page 1 2 3 4 Next page Last page  View All Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.