views:

447

answers:

5

I got a project in mind that makes it worth to finally take the plunge into programming.

After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is in the experimental stage, which wouldn't help me do this web app right now.

As for web app fast, I've checked out Django, Turbo Gears and Py2Web. In spite of spending a lot of time reading, I still have no clue which one I should use.

1) Django certainly has the nicest online presence, and a nicely done onsite tutorial, they sure know how to show off their thing.

2) Web2Py attracted me with its no-install-needed and the claim of making Django look complicated. But when you dig around on their website, you quickly find content that hasn't been updated in years with broken external links... There's ghosts on that website that make someone not intimately familiar with the project worry if it might be flatlining.

3) Turbo Gears ...I guess its modular too. People who wrote about it loved it... I couldn't find anything specific that might make it special over Django.

I haven't decided on an IDE yet, though I read all the answers to the Intellisense code completion post here. Showing extra code snippets would be cool too for noobs like me, but I suppose I should choose my web frame work first and then pick an editor that will work well with it.

Since probably no framework is hands down the best at everything, I will give some specifics on the app I want to build:

It will use MySQL, it needs register/sign-in, and there will be a load of simple math operations on data from input and SQL queries. I've completed a functional prototype in Excel, so I know exactly what I want to build, which I hope will help me overcome my noobness. I'll be a small app, nothing big.

And I don't want to see any HTML while building it ;-)

PS: thanks to the people running Stackoverflow, found this place just at the right moment too!

+1  A: 

I'd recommend Django.

  • Built-In Authentication and easy to use extensions for registration
  • Very good documentation
  • You probable write your HTML templates mostly in base.html, then just use template inheritance (Note: You'll need to write at least a little bit of HTML)
  • In contrast to Turbogears, Django is more 'out-of-the-box'
  • I don't have any experience with web2py, but from my impression, it tries to do a little to much 'out-of-the-box'
The MYYN
from the django tutorial, it seemed I can just copy some default templates into my app path and be done with it until the actual application is complete. And then I might get an inexplicable urge to redesign the template...?
Tsais
You can try. But then, HTML isn't that hard, either.
The MYYN
+1  A: 

If you "don't want to see any HTML while building it" then you can forget Django. It is not focused on "point-click-done," it is focused on pros going from concept to production in the shortest time possible. The hierarchical nature of the templating language can lead to some very clean overall site layouts. I use Django for all of my larger sites and I love it.

Although it's written in PHP, not Python, you might take a look at the major new version of WordPress that came out about 2 or 3 months ago. In 3.0 they have come a long way from being a "blogs only" environment and there are tons of ready-made templates for it. Of course if you want to tweak a template, well, there's that nasty old HTML again. I am considering using it for my smaller clients that can't deal with the admin of a dedicated server, etc., that tends to come with a Django site.

Update: Ah, I missed the semi-joke -- I was up too early and that tends to make me tone deaf to humor. As far as using templates from existing sites, I have done this quite successfully with a couple of sites, both those that were static and those originally driven by well-written PHP scripts. I recommend a careful reading of the {% extends %} and {% include %} docs. Both take either a string literal or a variable. I have used the later method and it can be quite useful for a site that has strong hierarchy distinguished by style changes across branches.

It is also worth the time to understand the search order for templates -- it can be used to good effect, but it can be puzzling if you don't grok it. See the template-related items in the settings.py file for this and other useful goodies.

Peter Rowell
I was half joking about the no-html comment... I can write html in my sleep, always been the photoshop/template person for work. So I'm just excited that it looked like Django lets me use existing default templates, so I can just focus on writing the database and math functionality, if I can't be bothered to fiddle with the looks. Automated collapsing fieldsets seemed to be enough layout control.
Tsais
thank you for the additional tips, its not always easy to know what to read and understand first...
Tsais
if you like wordpress look into instant press (written in web2py): http://code.google.com/p/instant-press/
mdipierro
@mdipierro: Very interesting! Thank you for the link!
Peter Rowell
A: 

If you decide to go with Django, make sure that you use its Generic Views. They will save you from writing lots of code, both Python and HTML.

Also, unless there is a very specific reason for you to use MySQL, I advise you to switch to PostgreSQL. Django is much more oriented towards PostgreSQL and it's a much better database anyway.

The online Django documentation is great, this is what put it apart from all the other frameworks. I also recommend the book Practical Django Projects by James Bennett

Cesar Canassa
why does this get downvoted?
Ben
yeah, definitely, their generic views have some pretty nice features!
Tsais
Wasn't me, I can't vote till I get 15 points... maybe someone misclicked? I think your answer is perfectly helpful and I'll give you a + once I can... I'd like to ask you why you like PostgreSQL better than MySQL. I was wondering myself if it was still a good idea to use MySQL now that Larry owns it. My main reason to stick to MySQL so far is that most hosting companies have it installed, and there's lots of open source tools for it. Though looking at Web2Py, I could pretty much use that to manage any supported database, which includes PostgreSQL...
Tsais
Check this thread: http://stackoverflow.com/questions/110927/do-you-recommend-postgresql-over-mysql --It has some good comments regards MySQL vs. PostgreSQL
Cesar Canassa
I am with Tsais on this one. MySQL owned by Oracle became a risky tool to use.
mdipierro
ok, so I read that big thread on MySQL vs PostgreSQL... overall a pretty big endorsement for PostgreSQL... But will I always need a minimum of a virtual co-location to install that for myself? I've never seen a cheap web host offering PostgreSQL. *goes rifling through Web2Py's hosting recommendations...
Tsais
Webfaction = cheap (as in prices, not quality) web host offering PostgreSQL. Plans start at $9.50/month (if you want to pay by the month, discounts for longer commitments). I am in no way affiliated with webfaction, other than being a very satisfied customer for more than a year.
mwolfe02
+3  A: 

You should look at the web2py online documentation (http://web2py.com/book). It comes with a Role Based Access Control (the most general access control mechanism) and it is very granular, you can grant access for specific operation on specific records. It comes with a web based IDE but you can use WingIDE and Eclipse too. It comes with helper system that allows you to generate HTML without using HTML. Here is an example of a complete app that requires users to register/login/post messages:

db.define_table('message',Field('body'),Field('author',db.auth_user))
@auth.requires_login()
def index():
    db.message.author.default=auth.user.id
    db.message.author.writable=False
    return dict(form=crud.create(db.message),
                messages=db(db.message.id>0).select())

The web2py project is very active as you can see from the list of changes http://code.google.com/p/web2py/source/list

If you have web2py related questions I strongly suggest you join the web2py mailing list: http://groups.google.com/group/web2py/topics

We are very active and your questions will be answered very quickly.

mdipierro
I was getting all ready to install django today, but after finding a pdf with a function by function comparison with code examples, I went to your links, and I've pretty much concluded that web2py is the most modern of the web frame works. Especially for someone new to programming, its super nice when security is handled for me, and I've always liked useful defaults in software.
Tsais
Also found a couple of well populated community sites, so I'm confident enough to go with the feature set I like best. My understanding of what's important is incomplete at best, but one never has more than current understanding to base decisions on ;-) So thank you very much for your answer, I'm posting this as I'm taking a short break from reading your manual ^^
Tsais
Feel free contact the mailing list or me personally for questions and advice.
mdipierro
One advice. If you are new to this start from this video: http://vimeo.com/13485916
mdipierro
Agree with Massimo - the web2py group is very helpful and friendly: http://groups.google.com/group/web2py/
Plumo
A: 
  • Django: Heard it has the best administrative interface. But uses it's own ORM, i.e. doesn't use SQL-Alchemy.

  • Web2py: Didn't research this.

  • Turbogears2: Uses SQL-Alchemy by default, uses Catwalk for admin interface, but documentation isn't as great.

I chose Turbogears2 because it uses popular components, so I didn't have to learn anything new...

Lionel
As far as I found in the meantime, you should research Web2Py, it seems to take no ugly shortcuts that could bite you later. Just a few sensible defaults, and you got control over everything in a fashion like this: you can let it generate your SQL code, and show it or not show it to you, or you can just write your own. Everything it does you can override. I think it doesn't just happen to be the newest, it is actually thought out with the advantages and disadvantages of older frameworks in mind, making it a solid technological advance.
Tsais