views:

271

answers:

4

Hello,

I am just starting to use a web framework. I have decided I really like python and started looking at web frameworks. I don't really like django for a few reasons, but from what I have tried so far I found I really like pylons.

The problem I have is that I can't find that many articles/tutorials about pylons, especially 1.0 articles. Does anybody know any good getting started tutorials and articles about pylons?

Also, I am gonna need to implement users in my applications with a secure log in and have the users "own" a model. Any good advice/articles/tutorials about how I would do this?

When I was looking at some tutorial they mention virtual python environments. I don't really know what that is, why you would use them and how do you use them. Any help?

Finally, I can't find any good tutorials/articles about how to deploy pylons to a production environment. I own a VPS and am gonna deploy there. Any help with that?

Is there anything else I should know about pylons or python. I know the basics of python already.

Thanks, Cam

+5  A: 

There is an entire book published free which covers Pylons 1.0:

http://pylonsbook.com/en/1.1/

meder
Wow, that looks awesome. Even published using Sphinx :)
AdmiralNemo
The book is version 1.1, but covers Pylons 1.0 (or maybe 0.9.7), not Pylons 1.1, since it does not exist (yet). Pylons is version 1.0 as of now (August 2010).But I agree this is a good source, it shows how to develop and deploy. But everyone seems to agree that AuthKit is not the best way for auth.
Antoine Leclair
If AuthKit is not the best way for authentication, then what is?
Conceited Code
Lot of people suggest repoze.who and repoze.what. I never tried it. I always roll out my own authentication layer since I do not always use SQL databases. In fact, I never looked at it, maybe they are flexible enough for nosql databases.
Antoine Leclair
Any good tutorials/articles about using repoze.who or repoze.what?
Conceited Code
+6  A: 

The book suggested by meder (http://pylonsbook.com/en/1.1/) is a very good start. I upvoted his anwser because that's where I learned Pylons.

However, the book is written for Pylons 0.9.7 (the latest version before 0.10 and 1.0).

Pylons is the agglomeration of several high quality libraries. Learning Pylons is all about learning those libraries. Most of the book is about exploring those libraries. When you learn to develop web app in Pylons, what you really learn is to develop app in Python.

Right now, I think the book and the official website (http://pylonshq.com/docs/en/1.0/) are the two most valuable resources to learn Pylons.

Most of the changes that happenned between 0.9.7 and 1.0 are in the app start-up (which you probably won't really try to modify at the begining). Other than that, the libraries have been updated (sqlalchemy is now 0.6, etc.). Also, one change that may affect you: the url_to and redirect_to functions have been replaced by url and redirect. That's about it.

Antoine Leclair
+2  A: 

You will definitely need to learn SQLAlchemy to master Pylons.

Official docs are pretty good start at it, http://www.sqlalchemy.org/docs/, and you may want to try Elixir extension, which provides a bit better declarative syntax.

You also should read docs on Routes module, http://routes.groovie.org/contents.html, especially on submappers and RESTful services, http://routes.groovie.org/restful.html

And you need to learn w/e templating system you choose. Mako, for example, have some non-obvious caveats, like much better performance of <%namespace/> vs <%include/>.

Daniel Kluev
+1  A: 

For authentication the homegrown decorator based approach works well also: http://wiki.pylonshq.com/display/pylonscookbook/Another+approach+for+authorization+in+pylons+%28decorator+based%2C+repoze.what+like%29

Blaise Laflamme