Need a compelling argument to use Django instead of Rails

R

Roman Susi

Ben said:
The problem is that Python is the 2nd best language for everything. ;)
As a general purpose language I don't think it can be beaten, but for
almost any given project of non-trivial size, there seems to always be
one language that has better support for the subject. I frequently find
myself wanting to use Python but being unable to, often due to some
library being unavailable, as in your case.

Is it a bad thing? In my opinion it is better to be 2nd place for a long
time than get to the top and fall short after that. Because then Python
will be associated with certain thing (like Ruby with Rails, Java with
Beans, C with two pluses, Fortran with 77 ;-)

Its healthy for a Pythons to live in many different ecosystems.

Regards,
Roman
 
B

Ben Sizer

Roman said:
Is it a bad thing?

I don't know. I suppose that depends on how you define 'bad'! For me,
it is often inconvenient, because I'd prefer to use Python but
generally find that I have to choose something else if I want to do the
best possible for any particular project.

In my case, multimedia and game support is patchy, and web development
support is still oriented towards the Java/enterprise user - if CGI
doesn't suffice, that is. In the original poster's case, it's seemingly
because specific database support seems to be lacking. Improving the
libraries in these areas would hopefully increase the diversity of
Python's potential applications rather than diminish it.
 
P

Paul Boddie

Ben said:
In my case, multimedia and game support is patchy,

There are lots of multimedia and game frameworks for Python. Which ones
have you tried and why are they insufficient?
and web development support is still oriented towards the Java/enterprise user - if CGI
doesn't suffice, that is.

Certainly, some Web frameworks have some element of Java flavouring,
but there's also considerable diversity at least at certain levels.
In the original poster's case, it's seemingly because specific database support seems to
be lacking. Improving the libraries in these areas would hopefully increase the diversity
of Python's potential applications rather than diminish it.

Last time I checked, which was admittedly a long time after I actually
needed the modules concerned, support for Oracle with Python was
actually pretty good. I suppose it's a case of the Django people
getting round to gluing the Oracle modules to their object-relational
mapper and making sure that it all still works, and perhaps some
motivated member of the Django community can step forward and do the
work to get it going. Otherwise, no amount of complaining will put the
two technologies together.

Paul
 
B

Ben Sizer

Paul said:
There are lots of multimedia and game frameworks for Python. Which ones
have you tried and why are they insufficient?

PyGame was barely maintained for a year, and is based on SDL which was
also barely maintained for a year, and which hasn't kept up with
hardware advances at all. On the graphical side you can opt for OpenGL,
the Python library for which is also barely maintained (though I hear
work is underway behind the scenes) and doesn't provide much more than
a minimal layer over the C interface anyway. DirectX support only
appeared this year unless you used IronPython, and it doesn't seem very
popular.

Which other frameworks are you thinking of? I know of a variety of
wrappers around individual libraries, and of wrappers around 3D engines
such as Irrlicht and Ogre, but not much else.
Certainly, some Web frameworks have some element of Java flavouring,
but there's also considerable diversity at least at certain levels.

Pretty much every Python web offering revolves around you having your
own server with the luxury of running your own long-running processes
on it. Great for business apps, not much use for the hobbyist or
independent site. There are probably some hosts that will provide
shared hosting for your Django or Turbogears app, but they are not
exactly numerous. The barrier to entry here is much higher than with
PHP or ASP, for example. And even with the full framework approach, the
field has been so fragmented until recently that in terms of community
support, you'd be better off opting for another language. I appreciate
there's a diversity vs. standardisation argument there which may never
be settled, so I accept this is just a personal opinion, but I do think
a critical mass of users is important with any technology.

I'm in a similar situation to the original poster; I'd like to use
Turbogears for an app I want to write, but will probably end up doing
it in PHP instead, because I can't get dedicated hardware or a local
host for Turbogears. (Never mind the lack of documentation.)
Otherwise, no amount of complaining will put the
two technologies together.

It's a fair point, but on the other hand, saying "if you want it doing,
do it yourself" doesn't objectively improve the status quo. If
something doesn't exist, it doesn't exist, and it's valid to comment
upon that fact.
 
R

Ray

Ben said:
I don't know. I suppose that depends on how you define 'bad'! For me,
it is often inconvenient, because I'd prefer to use Python but
generally find that I have to choose something else if I want to do the
best possible for any particular project.

Exactly. It's bad because Python is the language you'd love to use at
work but can't :) Don't tell me to look for a job in a Python shop,
there's none. OTOH, there IS at least one RoR shop that I know of and
they're doing pretty well!
In my case, multimedia and game support is patchy, and web development
support is still oriented towards the Java/enterprise user - if CGI
doesn't suffice, that is. In the original poster's case, it's seemingly
because specific database support seems to be lacking. Improving the
libraries in these areas would hopefully increase the diversity of
Python's potential applications rather than diminish it.

Yep, (support in Django, specifically, not Python).
 
R

Ray

Ben said:
a minimal layer over the C interface anyway. DirectX support only
appeared this year unless you used IronPython, and it doesn't seem very
popular.

IronPython is not released yet, I do hope it will become popular
though. It's in RC1 now and should be released soon. I'm really looking
forward to it!
Pretty much every Python web offering revolves around you having your
own server with the luxury of running your own long-running processes
on it. Great for business apps, not much use for the hobbyist or
independent site. There are probably some hosts that will provide
shared hosting for your Django or Turbogears app, but they are not
exactly numerous. The barrier to entry here is much higher than with
PHP or ASP, for example. And even with the full framework approach, the
field has been so fragmented until recently that in terms of community
support, you'd be better off opting for another language. I appreciate
there's a diversity vs. standardisation argument there which may never
be settled, so I accept this is just a personal opinion, but I do think
a critical mass of users is important with any technology.

Diversity can be a pain in the ass sometimes. Instead of ending up with
something really good you end up with a lot of mediocre stuff (Note:
I'm not saying anything about Django or Turbogears here, mind!).
Reminds me of the time when I was installing Linux for the first time
and finding out that there were tons of text editor included in the
distro. I only need vi so that wasn't a problem, but I could imagine
someone from a strictly Windows world would wish that there was only
one text editor :)
I'm in a similar situation to the original poster; I'd like to use
Turbogears for an app I want to write, but will probably end up doing
it in PHP instead, because I can't get dedicated hardware or a local
host for Turbogears. (Never mind the lack of documentation.)

Yep. And my case now is pretty much shot with no Oracle/SQL Server
support.
It's a fair point, but on the other hand, saying "if you want it doing,
do it yourself" doesn't objectively improve the status quo. If
something doesn't exist, it doesn't exist, and it's valid to comment
upon that fact.

Couldn't agree more. A lot of would-be users, upon being told that,
would simply turn to another framework/language/platform/whatever that
does provide the feature in question. This is especially true for
companies with fast moving projects like the one I'm working for at the
moment.

Of course, then we can always say, "sureeee, go ahead, your loss blah
blah blah" Well maybe. But how does it help ourselves really?
 
P

Paul Boddie

Ben said:
PyGame was barely maintained for a year, and is based on SDL which was
also barely maintained for a year, and which hasn't kept up with
hardware advances at all. On the graphical side you can opt for OpenGL,
the Python library for which is also barely maintained (though I hear
work is underway behind the scenes) and doesn't provide much more than
a minimal layer over the C interface anyway. DirectX support only
appeared this year unless you used IronPython, and it doesn't seem very
popular.

I can only profess familiarity with Pygame which still seems to do more
or less what it always did, although I haven't kept up with the
community, but I have recently released a simple game which seems to
work quite well. By "simple", I mean two-dimensional playing areas,
pre-recorded soundtracks, retro-style gameplay.

If I were to get into OpenGL, I'd look at stuff like PyQt alongside
other traditional bindings, mostly because such frameworks - certainly
Qt, as far as I've seen from various reports - usually incorporate a
lot of effort resulting from a serious amount of developer attention to
integrating such technologies and making them work reliably in a number
of environments.
Which other frameworks are you thinking of? I know of a variety of
wrappers around individual libraries, and of wrappers around 3D engines
such as Irrlicht and Ogre, but not much else.

If I were to consider other three-dimensional rendering technologies,
I'd probably look at things like Soya 3D, Panda3D and whatever other
people have dug up:

http://www.vrplumber.com/py3d.py

You also mentioned multimedia frameworks, and this is probably another
area where there are so many projects that it's hard to pick the good
ones.
Pretty much every Python web offering revolves around you having your
own server with the luxury of running your own long-running processes
on it. Great for business apps, not much use for the hobbyist or
independent site.

Once upon a time I used to advocate my WebStack framework as a solution
to this problem situation: WebStack applications run on BaseHTTPServer
or other monolithic servers (Webware, Twisted, Zope 2, Java Servlet),
but can also be deployed as CGI or in mod_python environments. The
apparent response to this advocacy (which was backed up by an actual
implementation) was that no-one needed such flexibility: an opinion
somewhat at odds with actual practice if you consider widely-deployed
applications such as ViewCVS/ViewVC, Trac, MoinMoin, and so on, where
all of these have provided their own server abstractions at least until
very recently.

Since that time, WSGI has emerged as an interoperability technology,
but the fundamental platform fragmentation issues remain, as everyone
attempts to show how easy it is to write "WSGI middleware". Moreover,
the server abstractions required by widely-deployed applications are
still necessary, and it is in precisely this area that framework
proliferation has occurred.
There are probably some hosts that will provide
shared hosting for your Django or Turbogears app, but they are not
exactly numerous. The barrier to entry here is much higher than with
PHP or ASP, for example.

I think the attitude has been that if you're not willing to lay out the
bucks (albeit not quite as much as it used to be now that virtual
private servers are becoming commonplace), the big players in the
frameworks scene aren't willing to pay you much attention. But as
applications like ViewCVS show, many people appreciate Web application
deployment on low-end hosting, and that not all Web applications are
part of some big Web 2.0 rollout.
And even with the full framework approach, the
field has been so fragmented until recently that in terms of community
support, you'd be better off opting for another language. I appreciate
there's a diversity vs. standardisation argument there which may never
be settled, so I accept this is just a personal opinion, but I do think
a critical mass of users is important with any technology.

I've said this a few times now, but it's worth repeating: when WSGI was
proposed as the next great thing in Python Web standardisation (a topic
in which no-one had any substantial interest until PHP/Ruby were
considered ahead of Python in certain much-discussed decisions), it was
formulated in such a way as to stay off the turf already occupied by
the significant Python frameworks of the time. The consequence of that
decision has been a slight, one centimetre upward movement of the
Python Web scene's "healthy competition" in the entire "framework
stack".
I'm in a similar situation to the original poster; I'd like to use
Turbogears for an app I want to write, but will probably end up doing
it in PHP instead, because I can't get dedicated hardware or a local
host for Turbogears. (Never mind the lack of documentation.)

Sorry to hear that! This point was probably raised a while ago on the
Web-SIG mailing list, and if you're bothered, I'm sure you can track
down whatever reasoning was put forward for the neglect of this
particular usage situation throughout the major frameworks.
It's a fair point, but on the other hand, saying "if you want it doing,
do it yourself" doesn't objectively improve the status quo. If
something doesn't exist, it doesn't exist, and it's valid to comment
upon that fact.

Well, returning to the original point, Oracle database modules have
existed for more than ten years and are presumably a mature area now.
Meanwhile, Django seemed to favour PostgreSQL as an RDBMS last time I
checked. All it takes is someone to stick their neck out and finish the
job - an activity which can admittedly seem suspended for years,
considering the varying levels of support for different database
systems in Webware's MiddleKit persistence layer over its lifetime.

Paul
 
B

Bruno Desthuilliers

Ben Sizer wrote:
(snip)
Pretty much every Python web offering revolves around you having your
own server with the luxury of running your own long-running processes
on it.

This is becoming less and less of a "luxury" - the cost of dedicated web
servers is really dropping at eyesight.
 
B

Ben Sizer

Paul said:
I can only profess familiarity with Pygame which still seems to do more
or less what it always did, although I haven't kept up with the
community, but I have recently released a simple game which seems to
work quite well. By "simple", I mean two-dimensional playing areas,
pre-recorded soundtracks, retro-style gameplay.

PyGame is great at what it does, which as you say, is usually
retro-style 2D games. It also provides a reasonable way of setting up a
window for input, sound mixing, etc. But its 2D technology is primitive
(eg. DirectDraw 6 on Windows if I remember correctly) and much of the
rest is not very advanced, such as limited support for controllers,
extra mouse buttons, 3D sound, etc. This is more a limitation of SDL
which got neglected in recent years.

Even C++ comes with OpenGL in the standard library. I am disappointed
that this hasn't become the case with Python. I don't even know if
PyOpenGL is compatible with the latest incarnation of NumPy or whether
you have to rebuild it all yourself. It's a bit of a mess really.
If I were to get into OpenGL, I'd look at stuff like PyQt alongside
other traditional bindings, mostly because such frameworks - certainly
Qt, as far as I've seen from various reports - usually incorporate a
lot of effort resulting from a serious amount of developer attention to
integrating such technologies and making them work reliably in a number
of environments.

Does PyQT play well with PyGame? And isn't it more of a windowing
environment?
Once upon a time I used to advocate my WebStack framework as a solution
to this problem situation: WebStack applications run on BaseHTTPServer
or other monolithic servers (Webware, Twisted, Zope 2, Java Servlet),
but can also be deployed as CGI or in mod_python environments. The
apparent response to this advocacy (which was backed up by an actual
implementation) was that no-one needed such flexibility: an opinion
somewhat at odds with actual practice if you consider widely-deployed
applications such as ViewCVS/ViewVC, Trac, MoinMoin, and so on, where
all of these have provided their own server abstractions at least until
very recently.

Of course, if you're a developer producing your own framework - as
pretty much everybody on the Web-SIG was - then you're presumably
already aiming at the dedicated hosting space, so it's not surprising
that such flexibility is not held in high regard by those.
I've said this a few times now, but it's worth repeating: when WSGI was
proposed as the next great thing in Python Web standardisation (a topic
in which no-one had any substantial interest until PHP/Ruby were
considered ahead of Python in certain much-discussed decisions), it was
formulated in such a way as to stay off the turf already occupied by
the significant Python frameworks of the time.

This is something I wasn't incredibly happy about, as I felt it meant
that personal egos were being saved at the expense of improving Python.
And I always thought that WSGI was solving the wrong problem. It
certainly didn't go very far towards meeting the expressed goals of the
Web-SIG. Oh well.
<http://mail.python.org/pipermail/web-sig/2004-August/000650.html>
 
S

Sybren Stuvel

Ben Sizer enlightened us with:
PyGame was barely maintained for a year, and is based on SDL which
was also barely maintained for a year, and which hasn't kept up with
hardware advances at all.

Still, ID Software and Epic both use SDL + OpenGL for their games. Why
is it good for them but insufficient for you?

Sybren
 
T

Terry Reedy

Ben Sizer said:
PyGame was barely maintained for a year, and is based on SDL which was
also barely maintained for a year, and which hasn't kept up with
hardware advances at all.

I believe there is a recent release of SDL, but which what advances I do
not know. Pygame is being actively worked on by more than one person.
tjr
 
V

Vincent Delporte

Ben Sizer wrote:
(snip)

BTW, what is the advantage of running a CherryPy/Django server instead
of the regular way of code in pages? Improved performance because the
Python interpreter is already up and running?
 
P

Paul Boddie

Ben said:
Even C++ comes with OpenGL in the standard library.

Which standard library?

[...]
Does PyQT play well with PyGame? And isn't it more of a windowing
environment?

I'll have to let that question go, but I imagine the PyQt mailing list
would be able to provide some kind of answer:

http://mats.imk.fraunhofer.de/pipermail/pykde/

As for the nature of PyQt, it is a framework for developing
applications of various kinds, with the graphical user interface part
being the most interesting for most Python developers, I imagine. I
have read that the drawing and rendering support is rather powerful in
PyQt4, and I believe that various Qt-based visualisation solutions
exist.

[Web-SIG standardisation]
This is something I wasn't incredibly happy about, as I felt it meant
that personal egos were being saved at the expense of improving Python.

And some of the old frameworks whose APIs were so sacred have since
been replaced by a selection of new frameworks, each with their own
variation on what could easily be a common API. The original exercise
which led to the making WebStack was to investigate and document just
how each of the main frameworks differed; what I learned was that the
sacred "convenient" APIs of numerous frameworks were frequently
underdefined wrappers around parts of the cgi module that, despite
protests to the contrary, were more or less providing the same
functionality with varying amounts of subjective convenience.

(To an extent, WebStack doesn't expose certain functionality of the old
cgi module API completely, either, but with a dose of additional
motivation, I'd probably update the API to do certain things in a more
satisfactory way whilst preserving the improved semantics.)
And I always thought that WSGI was solving the wrong problem. It
certainly didn't go very far towards meeting the expressed goals of the
Web-SIG. Oh well.
<http://mail.python.org/pipermail/web-sig/2004-August/000650.html>

There are some remarks just after that message about the SIG charter
needing to change or having become irrelevant, but in fact the need for
standard functionality is as relevant today as ever. At a slightly
higher level, everyone would now prefer that you buy into their total
"full stack" solution, perhaps with the exception of the Paste
developers whose selection of packages either suggest a problem of
internal framework proliferation or one of a lack of coherency in
presenting a suitable solution to the casual inquirer.

Given the amount of traffic the Web-SIG mailing list has been getting,
it's safe to say that while many would consider the job done, the
project has mostly failed in meeting its objectives.

Paul
 
T

Tim Roberts

Vincent Delporte said:
BTW, what is the advantage of running a CherryPy/Django server instead
of the regular way of code in pages? Improved performance because the
Python interpreter is already up and running?

Exactly. The Python interpreter can take a significant fraction of a
second to start. For the typical short web request, the overhead can add
up.

On the other hand, unless you're handling dozens of requests per minute,
users are unlikely to notice.

You can also keep session state in memory instead of spilling to disk, and
you can keep database sessions open.
 
V

Vincent Delporte

Exactly. The Python interpreter can take a significant fraction of a
second to start. For the typical short web request, the overhead can add
up.

On the other hand, unless you're handling dozens of requests per minute,
users are unlikely to notice.

You can also keep session state in memory instead of spilling to disk, and
you can keep database sessions open.

Thanks for the explanations.
 
B

Ben Sizer

Paul said:
Which standard library?

Sorry, it was a long day, and I used entirely the wrong term here. By
that, I meant "typically shipped with each compiler". I've never had to
even install a development library to use OpenGL, whether under Win32
or Linux. It's just a typical part of the distribution.
[Web-SIG standardisation]
And I always thought that WSGI was solving the wrong problem. It
certainly didn't go very far towards meeting the expressed goals of the
Web-SIG. Oh well.
<http://mail.python.org/pipermail/web-sig/2004-August/000650.html>

There are some remarks just after that message about the SIG charter
needing to change or having become irrelevant, but in fact the need for
standard functionality is as relevant today as ever. At a slightly
higher level, everyone would now prefer that you buy into their total
"full stack" solution, perhaps with the exception of the Paste
developers whose selection of packages either suggest a problem of
internal framework proliferation or one of a lack of coherency in
presenting a suitable solution to the casual inquirer.

Yeah. On the server side I think there's been a sad lack of attention
to the large middle ground that lies between simple CGI scripting and
full stack solutions. In fact, I'd guess that the majority of web sites
fall into that middle ground, just perhaps not the most interesting or
financially lucrative ones. Examples might be things like the various
PHP forums, or web-based non-real-time games. These applications are
complex enough to deserve a decent implementation language such as
Python, yet simple and small enough that most users won't want to set
up dedicated hardware for the purpose. I think there's definitely scope
in the standard library to go well beyond the current cgi module and
the piecemeal offerings in other modules, without needing to provide
another integrated web stack.
 
B

Ben Sizer

Sybren said:
Ben Sizer enlightened us with:

Still, ID Software and Epic both use SDL + OpenGL for their games. Why
is it good for them but insufficient for you?

Because id and Epic have many millions of dollars and better developers
to throw at the problem than I do. :) To put it another way, they have
lots of in-house middleware that is built on top of those technologies
to make them more effective. SDL and OpenGL is the bottom of the stack
for them. We mere mortals often prefer to start with something a little
higher level. :)
 
B

Ben Sizer

Terry said:
I believe there is a recent release of SDL, but which what advances I do
not know. Pygame is being actively worked on by more than one person.

The recent release of SDL was another minimal one, though there is an
intention to make the important changes 'soon'. As for PyGame, it's
good that development there has picked up again but I'd love to see it
broaden its horizons beyond SDL. Maybe that is impractical, however.
 
G

Gerhard Fiedler

Exactly. The Python interpreter can take a significant fraction of a
second to start. For the typical short web request, the overhead can add
up.

Is this start-up overhead the same thing for PHP? Or is this handled
differently there?

Gerhard
 
B

Ben Sizer

Gerhard said:
Is this start-up overhead the same thing for PHP? Or is this handled
differently there?

Typically you run PHP as a module in your webserver, so there should be
no process startup overhead. mod_python provides the same sort of
functionality for Python, but is not as popular or widely installed as
the PHP Apache module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top