mario ruggier wrote:
With respect to to original question regarding web frameworks +
database and Python 3, all the following have been available for
Python 3 since the day Python 3.0 was released:
QP, a Web Framework
http://pypi.python.org/pypi/qp/
Durus, a Python Object Database (the "defaul
On Oct 30, 6:23 pm, Dotan Cohen wrote:
> The point is that I want to use only _Python_ features, not
> Django/Mako/whatever features.
Pure python has a builtin templating system -- its called %
See http://simonwillison.net/2003/Jul/28/simpleTemplates/
--
http://mail.python.org/mailman/listinf
With respect to to original question regarding web frameworks +
database and Python 3, all the following have been available for
Python 3 since the day Python 3.0 was released:
QP, a Web Framework
http://pypi.python.org/pypi/qp/
Durus, a Python Object Database (the "default" in qp, for user
sessi
Rober Kern wrote
> But if you insist, you may be interested in Breve:
> http://pypi.python.org/pypi/Breve/
Thanks for that! Viva internal DSLs!
[Sorry -- cut my teeth on lisp]
Is there anything like this for xml?
Well I guess that is a slightly wrong (if not straight stupid) question.
Maybe s
>> notmm uses Python 2.6 and will probably work just fine with Python
>> 3000.
>>
The only reference to "notmm" that I could find in Google was this thread!
> "I am free, no matter what rules surround me. If I find them
> tolerable, I tolerate them; if I find them too obnoxious, I break
> them.
On Oct 30, 7:01 pm, erob wrote:
> On Oct 28, 5:16 am, "Diez B. Roggisch" wrote:
>
>
>
> > Dotan Cohen schrieb:
>
> > >> While I know that to be true in the general sense, from what I've
> > >> looked at Django and other frameworks it seems that the web frameworks
> > >> push the coder to use temp
On Oct 28, 5:16 am, "Diez B. Roggisch" wrote:
> Dotan Cohen schrieb:
>
>
>
> >> While I know that to be true in the general sense, from what I've
> >> looked at Django and other frameworks it seems that the web frameworks
> >> push the coder to use templates, not letting him near the HTML.
>
> >>
On 2009-10-30 15:55 PM, Dotan Cohen wrote:
It is clear and obvious. But it has the "template engine" duplicating
a function that Python has built in. My goal is to learn reusable
Python (reusable for non-web projects). My goal is not to find the
quickest way to a website.
Please correct me if I
> I took a look a both yesterday. They are both generic text templating
> systems that seem to pretty much do the same thing. I suspect you will
> prefer Mako since it avoids duplicating Python's comtrol structures. But I
> think it worthwhile to look at both anyway since doing so will help to
> se
>> It is clear and obvious. But it has the "template engine" duplicating
>> a function that Python has built in. My goal is to learn reusable
>> Python (reusable for non-web projects). My goal is not to find the
>> quickest way to a website.
>
> Please correct me if I'm wrong, but you did learn HTM
Dotan Cohen wrote:
It is clear and obvious. But it has the "template engine" duplicating
a function that Python has built in.
...
Then use Mako - it uses plain Python to manage the presentation logic. And
if you go for Mako, then you might as well switch to Pylons. Great framework
too (bett
Dotan Cohen a écrit :
Look at this "templating code":
{% for entry in blog_entries %}
{{ entry.title }}
{{ entry.body }}
{% endfor %}
What's the problem ? Simple, clear and obvious.
It is clear and obvious. But it has the "template engine" duplicating
a function that Python has built in
>> Look at this "templating code":
>> {% for entry in blog_entries %}
>> {{ entry.title }}
>> {{ entry.body }}
>> {% endfor %}
>
> What's the problem ? Simple, clear and obvious.
>
It is clear and obvious. But it has the "template engine" duplicating
a function that Python has built in. My g
Diez B. Roggisch a écrit :
The point is that using templates allows you to express your rendering-logic
in terms of the desired output language (HTML in this case).
Well, for Django, Mako, Cheetah and quite a few others, this might not
be _that_ true - you can use any of the templating system
Dotan Cohen wrote:
>> Perhaps this might better answer your questions:
>> http://docs.djangoproject.com/en/dev/topics/templates/#id1
>>
>
> Actually, that example just proves my point! Look at this "templating
> code":
> {% for entry in blog_entries %}
> {{ entry.title }}
> {{ entry.body
Bruno Desthuilliers wrote:
Dotan Cohen a écrit :
I don't want to learn some
"templating language" that duplicates what Python already has built
in!
Then use Mako - it uses plain Python to manage the presentation logic.
And if you go for Mako, then you might as well switch to Pylons. Great
f
Dotan Cohen a écrit :
Perhaps this might better answer your questions:
http://docs.djangoproject.com/en/dev/topics/templates/#id1
Actually, that example just proves my point!
Which one ?
Look at this "templating code":
{% for entry in blog_entries %}
{{ entry.title }}
{{ entry.body
Dotan Cohen a écrit :
2009/10/29 Albert Hopkins :
On Wed, 2009-10-28 at 16:38 +0200, Dotan Cohen wrote:
return HttpResponse(unmaintanable_html % data)
That's fine for single variables, but if I need to output a table of
unknown rows? I assume that return means the end of the script.
Therefor
Dotan Cohen a écrit :
Ok, here's a Django example without a template:
# views.py
def index(request):
torvalds = request.GET.get("torvalds", "No torvalds here")
return HttpResponse("%s" % torvalds)
Allright, but what if I need to output in the middle of the page? Say,
one row of a tabl
> Perhaps this might better answer your questions:
> http://docs.djangoproject.com/en/dev/topics/templates/#id1
>
Actually, that example just proves my point! Look at this "templating code":
{% for entry in blog_entries %}
{{ entry.title }}
{{ entry.body }}
{% endfor %}
Why would I want t
Dotan Cohen a écrit :
What do you mean by "in the middle of the page"? Do you mean, for instance,
the behavior of "middle.php" in the following PHP example:
Is that what you are after?
Yes, that is what I am after.
Django's templating system has an "include" statement, but also
something
>> As is, in my case. Actually, what use case is there for having Apache
>> reprocess the HTML output of the script?
>
> compression, cache, whatever...
>
Thanks. I actually did think of compression.
>>> It's not that it was unclear, but that it's innaccurate. "outputting to
>>> stdout" is an im
Dotan Cohen a écrit :
(snip)
Yes, I like to separate HTML from code. However, often I need to
output something in the middle of the page. How could I do that with a
template?
Perhaps learning to use some templating system could help ?-)
I'd personnaly suggest either Mako (possibly one of the
Dotan Cohen a écrit :
Clearly. I was referring to stdout being send to the browser as the
http response.
s/browser/web server/ - it's the web server that reads your app's stdout and
send it (as is or not FWIW) back to the client.
As is, in my case. Actually, what use case is there for having
2009/10/29 Albert Hopkins :
> On Wed, 2009-10-28 at 16:38 +0200, Dotan Cohen wrote:
>> > return HttpResponse(unmaintanable_html % data)
>> >
>>
>> That's fine for single variables, but if I need to output a table of
>> unknown rows? I assume that return means the end of the script.
>> Therefore I
> I think you're misunderstanding how Python and the web work together. Python
> is not PHP -- it was not designed to replace HTML, and it is in itself not a
> templating language. If you would like to use Python code embedded in HTML,
> the way PHP is typically used, you may want to look at Python
Martin v. Löwis 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
John Nagle wrote:
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
On Wed, 28 Oct 2009 07:08:12 -, John Nagle wrote:
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 w
On Wed, 2009-10-28 at 16:38 +0200, Dotan Cohen wrote:
> > return HttpResponse(unmaintanable_html % data)
> >
>
> That's fine for single variables, but if I need to output a table of
> unknown rows? I assume that return means the end of the script.
> Therefore I should shove the whole table into a
On Wed, 28 Oct 2009 14:15:54 -0700, Dotan Cohen
wrote:
What do you mean by "in the middle of the page"? Do you mean, for
instance,
the behavior of "middle.php" in the following PHP example:
Is that what you are after?
Yes, that is what I am after. For instance, if one were to look at
On Wed, 2009-10-28 at 15:32 +0200, Dotan Cohen wrote:
> > def index(request):
> >unmaintanable_html = """
> >
> >
> >Index
> >
> >
> >Embedded HTML is a PITA
> >but some like pains...
> >
> >
> > """
> >return HttpResponse(unmaintanable_html)
> >
>
> And if I need to
> What do you mean by "in the middle of the page"? Do you mean, for instance,
> the behavior of "middle.php" in the following PHP example:
>
>
> include_once("beginning.inc.php");
>
> include_once("middle.php");
>
> include_once("end.inc.php");
>
> ?>
>
> Is that what you are after?
>
Yes, that i
On Wed, 28 Oct 2009 12:42:17 -0700, Dotan Cohen
wrote:
I've already given you that for TG:
class RootController(BaseController):
@expose()
def page(self, torwalds=None):
return "%s" % (torwalds if
torwalds
else ""
Does return mean that this could not be used in the middle of
>> Actually, currently in the example url
>> http://example.com/path/to/script.py?var1=hello&var2=world the script
>> is /home/user/site-name/public_html/path/ (with no filename extension)
>> and the script.py is actually page.html which is an arbitrary,
>> descriptive string and not part of the sc
> I've already given you that for TG:
>
> class RootController(BaseController):
>
> @expose()
> def page(self, torwalds=None):
> return "%s" % (torwalds if torwalds
> else ""
>
Does return mean that this could not be used in the middle of a page?
> Of course nobody would do it that way
>> It
>> did not look like I had any control over the tags at all.
>
> I can tell you you have full control over the whole HTTP response's content
> and headers. And FWIW, this has nothing to do with templating systems.
>
That's good to know. Actually, it's more that good: I am looking into
Django
Diez B. Roggisch wrote:
John Nagle schrieb:
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" pr
Dotan Cohen a écrit :
*Why* on earth do you think using a templating system will give you any less
control on the generated HTML ?
Because I am wrong. I have already come to that conclusion.
I know that Python is far enough developed that if I feel that I am
fighting it, then _I_ am in the wr
> *Why* on earth do you think using a templating system will give you any less
> control on the generated HTML ?
>
Because I am wrong. I have already come to that conclusion.
I know that Python is far enough developed that if I feel that I am
fighting it, then _I_ am in the wrong, not Python. How
Dotan Cohen a écrit :
>>> I insist on handling the HTML myself.
>> I just don't get how embedding HTML in applicative code - a well-known
>> antipattern FWIW - relates to "handling the HTML yourself". Can you
*please*
>> explain how a templating system prevents you from "handling the HTML"
>> yo
Dotan Cohen a écrit :
While I know that to be true in the general sense, from what I've
looked at Django and other frameworks it seems that the web frameworks
push the coder to use templates, not letting him near the HTML.
Well... there must be a reason, for sure... No ?
ֹYes, but I don't like
Dotan Cohen a écrit :
I have no idea what reverse url generation is.
It's a mean to avoid hard-coding urls in your application code - the url is
fully generated by the 'url mapping' system.
I don't need that, see below.
I assume that the user
will call http://example.com/path/to/script.py?
Dotan Cohen wrote:
>>> I insist on handling the HTML myself.
>>
>> I just don't get how embedding HTML in applicative code - a well-known
>> antipattern FWIW - relates to "handling the HTML yourself". Can you
>> *please* explain how a templating system prevents you from "handling the
>> HTML" your
>> I insist on handling the HTML myself. As for converting the request
>> variables into Python variables, if a class/framework makes that
>> easier then I would gladly use it. My question was serious. How can I
>> do those things?
>
> Using a framework? In Pylons/TG2, my code looks like this:
>
>
>> I insist on handling the HTML myself.
>
> I just don't get how embedding HTML in applicative code - a well-known
> antipattern FWIW - relates to "handling the HTML yourself". Can you *please*
> explain how a templating system prevents you from "handling the HTML"
> yourself.
>
>From the little
While I know that to be true in the general sense, from what I've
looked at Django and other frameworks it seems that the web frameworks
push the coder to use templates, not letting him near the HTML.
>>>
>>> Well... there must be a reason, for sure... No ?
>>>
>>
>> ֹYes, but I don'
>> I have no idea what reverse url generation is.
>
> It's a mean to avoid hard-coding urls in your application code - the url is
> fully generated by the 'url mapping' system.
>
I don't need that, see below.
>> I assume that the user
>> will call http://example.com/path/to/script.py?var1=hello&
Dotan Cohen wrote:
>>> I should probably expand on this:
>>>
>>> How can I get an array with all the GET variables in Python?
>>> How can I get an array with all the POST variables in Python?
>>> How can I get an array with all the COOKIE variables in Python?
>>> How can I get the request URI path
Dotan Cohen a écrit :
I should probably expand on this:
How can I get an array with all the GET variables in Python?
How can I get an array with all the POST variables in Python?
How can I get an array with all the COOKIE variables in Python?
How can I get the request URI path (everything after
Dotan Cohen a écrit :
While I know that to be true in the general sense, from what I've
looked at Django and other frameworks it seems that the web frameworks
push the coder to use templates, not letting him near the HTML.
Well... there must be a reason, for sure... No ?
ֹYes, but I don't lik
Dotan Cohen a écrit :
2009/10/28 Bruno Desthuilliers :
Dotan Cohen a écrit :
declarative mapping of urls to code
Apache does this, unless I am misunderstanding you.
Using url rewriting ? Yes, fine. Then tell me how you implement "reverse"
url generation (like Django or Routes do).
I have no
>> How can I get an array with all the GET variables in Python?
>> How can I get an array with all the POST variables in Python?
>> How can I get an array with all the COOKIE variables in Python?
>> How can I get the request URI path (everything after
>> http://[www.?]example.com/)?
>>
>> That's al
>> While I know that to be true in the general sense, from what I've
>> looked at Django and other frameworks it seems that the web frameworks
>> push the coder to use templates, not letting him near the HTML.
>
> Well... there must be a reason, for sure... No ?
>
ֹYes, but I don't like it.
>> D
2009/10/28 Bruno Desthuilliers :
> Dotan Cohen a écrit :
>>>
>>> declarative mapping of urls to code
>>
>> Apache does this, unless I am misunderstanding you.
>
> Using url rewriting ? Yes, fine. Then tell me how you implement "reverse"
> url generation (like Django or Routes do).
I have no idea w
>> I should probably expand on this:
>>
>> How can I get an array with all the GET variables in Python?
>> How can I get an array with all the POST variables in Python?
>> How can I get an array with all the COOKIE variables in Python?
>> How can I get the request URI path (everything after
>> http
Hello, Dotan
On Wed, 28 Oct 2009 10:26:22 +0200
Dotan Cohen wrote:
> I should probably expand on this:
>
> How can I get an array with all the GET variables in Python?
> How can I get an array with all the POST variables in Python?
> How can I get an array with all the COOKIE variables in Python
John Nagle a écrit :
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 Pyth
Dotan Cohen a écrit :
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 fra
Dotan Cohen a écrit :
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 sa
Dotan Cohen a écrit :
declarative mapping of urls to code
Apache does this, unless I am misunderstanding you.
Using url rewriting ? Yes, fine. Then tell me how you implement
"reverse" url generation (like Django or Routes do).
of code to templates
Those who code in HTML don't need thi
John Nagle schrieb:
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 Pytho
Dotan Cohen schrieb:
While I know that to be true in the general sense, from what I've
looked at Django and other frameworks it seems that the web frameworks
push the coder to use templates, not letting him near the HTML.
For instance, I was looking for a class / framework that provided a
proven
> Even 2.6 is too bleeding-edge? Uh oh, Fedora 12 is shipping it.
>
Fedora has traditionally been known as a bleeding edge distro.
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
--
http://mail.python.org/mailman/listinfo/python-list
> While I know that to be true in the general sense, from what I've
> looked at Django and other frameworks it seems that the web frameworks
> push the coder to use templates, not letting him near the HTML.
>
> For instance, I was looking for a class / framework that provided a
> proven method of d
John Nagle writes:
> 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.
Even 2.6 is too bleeding-edge? Uh oh, Fedora 12 is shipping it.
--
http://mail.python.org/mailman/listinfo/python-list
> 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 abo
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.
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 sam
On Tue, Oct 27, 2009 at 4:52 PM, Dotan Cohen 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 i
> 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. Espec
On Tue, Oct 27, 2009 at 3:11 PM, Dotan Cohen 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
On Oct 27, 10:26 am, "Diez B. Roggisch" 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/my
> 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 abo
On Tue, Oct 27, 2009 at 2:36 PM, Dotan Cohen 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
> 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 fun
> 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 P
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, abstra
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 q
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>
wrote:
I am very much new to Python, and one of my first projects is a simpl
Aaron Watters wrote:
On Oct 25, 7:52 pm, 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 (I can hear many of
you shouting "don't - start with 2.6"), but as far as I can see, none of
the popular p
On Oct 25, 7:52 pm, 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 (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 framew
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 compati
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 th
Exarkun - thanks for the reply
> don't - start with 2.6
Thought you might say that ;-)
Regards,
Alan
On 25 Oct, 11:52 pm, 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
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
wrote:
>
> I am very much new to Python, and o
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
>
> 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 conc
On 25 Oct, 11:52 pm, 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 fr
Alan Harris-Reid 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, Cherr
90 matches
Mail list logo