Framework for a beginner

B

biofobico

I am new to python and only have read the Byte of Python ebook, but want tomove to the web. I am tired of being a CMS tweaker and after I tried python, ruby and php, the python language makes more sense (if that makes any "sense" for the real programmers). I heard a lot of good things about Django,Pyramid, etc, but I dont want to pick the most used or the one with the most magic. Instead I was thinking about one that could "teach" me python along the way. My plan is to rebuild my portfolio using python and a frameworkand also benefit my python learning along the way.

Thanks in advance.
 
B

Bryan

biofob said:
I am new to python and only have read the Byte of Python ebook, but want to move to the web. I am tired of being a CMS tweaker and after I tried python, ruby and php, the python language makes more sense (if that makes any "sense" for the real programmers). I heard a lot of good things about Django, Pyramid, etc, but I dont want to pick the most used or the one with the most magic. Instead I was thinking about one that could "teach" me python along the way. My plan is to rebuild my portfolio using python and a framework and also benefit my python learning along the way.

Warning: I'm a mere dabbler in web frameworks.

If by rebuilding your portfolio you mean to position yourself for a
job, then popularity counts a lot. As measured by job openings, Django
is king. It's a fine framework and reasonably Pythonic. The Django
community is large and sophisticated and helpful They have there own
app download system, which I haven't used but is supposed to work
really well. Django has emphasized backwards compatibility with the
down-side that, last I heard, there was no plan to move to Python 3.

Your disinterest in "magic" plays against Web2Py. Were the goal to go
from squat to professional quality web site quickly and easily, Web2Py
would be it.

Web2Py does a load of complex and interesting stuff behind the scenes.
Among web frameworks, it rocks like none other at teaching and using
web best-practices, at the cost of hiding or skirting core Python
practices. Professor Massimo DiPierro fist built Web2Py for his own
particular problem: teaching web programming in one semester. Without
it, his students spent so much time on the tools that his course could
not cover the essential topics.

Turbo-Gears has a lot going for it, largely by adoption. It demands
more elbow-grease than Django or Web2Py, but the extra effort has
benefits beyond the framework. In particular, Turbo-Gears has adopted
SQLAlchemy, which is significantly more demanding and vastly more
powerful than the purpose-built automatic table-generators of Django
and Web2Py.

Then there are the less than full-stack frameworks and libraries. But
this post is probably too long already.
 
R

Roy Smith

Bryan said:
Django has emphasized backwards compatibility with the
down-side that, last I heard, there was no plan to move to Python 3.

Hardly. See https://www.djangoproject.com/weblog/2012/mar/13/py3k/

I agree that Django is probably what the OP should be looking at, for
most of the reasons you mention. The ecosystem/community which has
grown up around Django is a major plus.

I've done a couple of projects in Django, ranging from a fairly simple
site based on django-cms, to a REST API server with a MongoDB back end.

This later site actually used very little of Django's capabilities. I'm
using the url routing, middleware framework, and session management, and
that's about it. No templates, no ORM (at least not the one that comes
with Django). But even with just using those small pieces, there was
enough value in the scaffolding I got from Django to make it a good pick.
 
G

Gerd Niemetz

Am Mittwoch, 11. April 2012 22:11:37 UTC+2 schrieb (e-mail address removed):
I am new to python and only have read the Byte of Python ebook, but want to move to the web. I am tired of being a CMS tweaker and after I tried python, ruby and php, the python language makes more sense (if that makes any "sense" for the real programmers). I heard a lot of good things about Django, Pyramid, etc, but I dont want to pick the most used or the one with the most magic. Instead I was thinking about one that could "teach" me python along the way. My plan is to rebuild my portfolio using python and a framework and also benefit my python learning along the way.

Thanks in advance.

Hi!

Take a look at http://www.web2by.com, a powerful and easy to learn python framework, and the community at https://groups.google.com/forum/?fromgroups&hl=de#!forum/web2py is also very helpful

regards,
Gerd
 
G

Gerd Niemetz

Am Mittwoch, 11. April 2012 22:11:37 UTC+2 schrieb (e-mail address removed):
I am new to python and only have read the Byte of Python ebook, but want to move to the web. I am tired of being a CMS tweaker and after I tried python, ruby and php, the python language makes more sense (if that makes any "sense" for the real programmers). I heard a lot of good things about Django, Pyramid, etc, but I dont want to pick the most used or the one with the most magic. Instead I was thinking about one that could "teach" me python along the way. My plan is to rebuild my portfolio using python and a framework and also benefit my python learning along the way.

Thanks in advance.

Hi!

Take a look at http://www.web2py.com, a powerful and easy to learn python framework, and the community at https://groups.google.com/forum/?fromgroups#!forum/web2py is also very helpful

regards,
Gerd
 
L

lkcl

I am new to python and only have read the Byte of Python ebook, but want to move to the web. I am tired of being a CMS tweaker and after I tried python, ruby and php, the python language makes more sense (if that makes any "sense" for the real programmers).

yeah, it does :) python is... the best word i can describe it is:
it's beautiful. it has an elegance of expression that is only marred
by the rather silly mistake of not taking map, filter and reduce into
the list object itself: l.map(str) for example would be intuitive,
compact and elegant. instead, i have to look up how to use map each
and every damn time! the reason for the mistake is historical: map,
filter and reduce were contributed by a lisp programmer. that lisp
programmer, presumably, was used to everything being function(args...)
and it simply didn't occur to anyone to properly integrate map, filter
and reduce properly into the list objects that they work with.

*shrugs* :) but that's literally the only thing about python that i
could possibly complain about. everything else, it's just...
beautiful. i think also that as a general rule, python programmers
are just... more intelligent. either it does something to their
brains, or... yeah :)

I heard a lot of good things about Django, Pyramid, etc, but I dont want to pick the most used or the one with the most magic. Instead I was thinking about one that could "teach" me python along the way. My plan is to rebuild my portfolio using python and a framework and also benefit my python learning along the way.

as you've seen quite a few people respond already by now, i won't
extol the virtues of different web frameworks, but one thing that's
very hard to assess is what you need. what exactly do you intend to
do?

let me give you an example. i started doing web programming with
python, back in 2001. the only available big web framework was zope,
and it was far too cumbersome. so i wrote my own sql table-generator
(called pysqldb - you can still find it on sourceforge), and i wrote
my own HTML table and form generator. i used cgi-bin. that was good
enough.

then i discovered ian bicking's sqlobject and sqlforms, and started
using that, for a bit (it became the basis of turbogears).

_then_ i discovered django, and went nuts over that.

and theeeeen, i discovered pyjamas, but i *still* used django for the
back-end, because of the database table capabilities, and *especially*
because of django south (and then django evolution) which, in a large
environment where stability and stable upgradeablity is paramount, you
really _really_ should investigate.

theeen, because pyjamas basically uses JSONRPC, and you only need to
use HTTP POST for file uploads and HTTP GET for file downloads, i
started looking at alternative _really_ minimalist frameworks, and i
mean severely minimalist. mod_python (yes really *just* mod_python -
not even a framework!), going back to cgi-bin with a view to doing
fast_cgi in a single process, and even experimented with using yield
and generators but that's getting seeeriously esoteric. more recently
i've discovered mongrel2, which i love, and will play with more when i
have a chance or the need.

but for the latest project, i'm not even using SQL: i'm using
something called kirbybase, and i'm using cgi-bin. there's simply no
need for speed: i don't _want_ to install django when it's not even
needed. i needed file upload: i just used CGI multi-part forms by
googling for it (there's a recipe on activestate that's about 30 lines
of code demo). i needed file download: i googled "cgi-bin python file
download" and yet again, another recipe on activestate showed me how:
it's doable in about 20 lines. i wrote a JSONRPC service - again cgi-
bin based: it's 140 lines of code. that's enough - it does the job,
and i don't need more!

http://pyjs.org/pygit/pygit.html?re...r&id=4fb8b7d7902ddbb79507c977eb52f6645f9912ef

so the point is: if you don't need something, and you're never going
to need it, don't use it. i stuck with django not because of django,
but because the database migration module is just fricking awesome.
but when i didn't even need SQL relational queries, i dropped the
whole of django like a stone.

so - really: you really do need to let us know what kinds of web sites
you intend to write. are they static (unlikely), is there data
involved, is there file upload/download involved, will there be lots
of data input, will there be automatic file creation involved (PDF
reports from database queries for example), will there be multimedia
(audio, video, live or just pre-recorded) involved, etc. etc.

all of these things have such a massive influence on what's best
practice to use, dude :)

l.
 
L

lkcl

If by rebuilding your portfolio you mean to position yourself for a
job, then popularity counts a lot. As measured by job openings, Django
is king.

yeah i can attest to that. i never get the jobs, though :)
 
R

Roy Smith

Kiuhnm said:
I don't like when a community imposes style on a programmer. For
instance, many told me that I shouldn't use camelCase and I should
adhere to PEP8.
Well, that's not me. I write my code the way I like it and if that is
frowned upon by some "standardizing" community, so be it.
I want to retain my freedom of expression.

Freedom of expression is fine, until you have to work in a big group.
The more everybody uses the same style, the easier it is for everybody
to understand everybody else's code.

There's another nice thing about PEP-8, or at least about the concept of
an official global style. I've been in groups where a huge amount of
time has been wasted arguing about style. In my current gig, when it
came time to decide on a style, the conversation went something like one
person suggesting we just use PEP-8 and everybody else nodding in
agreement. In 2 minutes, we saved many person-months of arguing.
 
N

Neil Cerutti

I don't like when a community imposes style on a programmer.
For instance, many told me that I shouldn't use camelCase and I
should adhere to PEP8.

Well, that's not me. I write my code the way I like it and if
that is frowned upon by some "standardizing" community, so be
it. I want to retain my freedom of expression.

"Choose a reasonable style, preferably ours, and stick with it."
--Brian Kernighan and Bob Pike, The Practice of Programming

On the other hand, if you're writing Python code that will
comprise the standard library, then, "Stick with it," means,
"Follow PEP8."

Adopting PEP8 for all Python code (something PEP8 does not call
for) supports the Python community by making your code more
digestible to the general Python user. So when you receive that
advice, it is not meant to make your code better, but to increase
your code's fidelity within the Python community.
 
B

Bryan

Gerd said:
Take a look at http://www.web2py.com, a powerful and easy to learn python framework, and the community at https://groups.google.com/forum/?fromgroups#!forum/web2py is also very helpful

Web2py rocks. It does by default better than many, probably most,
professional web programmers do for their living. A prominent
commercial publication extolled ranked it: best-open-source-
application-development-software of the last year.
http://www.infoworld.com/d/open-sou...tware-171759-0&current=10&last=1#slideshowTop

Hope that URL works. Users of web2py generally produce shorter,
simpler, more elegant URL's. I have my reservations about whether
web2py is the best answer for the O.P. here, and on that I stand by my
previous reporting.

At risk of making the same mistake twice in one short thread: Last I
heard -- please correct me if I'm wrong -- Web2py had no plan for to
move to Python 3.


-Bryan
 

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,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top