Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How could someone start Python programming with webapp2 ? This is weird. Of course Rails felt like an improvement for him.


Actually, I started with Django, then got pissed off because trying to twist Django around to do something non-traditional gets messy fast. webapp2 is spartan by comparison and makes you do more extra work, but at least you know what you're getting into because you have to write a lot of it yourself.


First of: I'm trying to be helpful, not a fanboy.

Where did you get stumped with Django?

I use Django to do all kinds of "non-traditional" stuff (key-based API authentication, automatic object-level caching, custom form fields, using Postgres features such as UUID fields and fulltext search) and none of it took me that much work. But then, I've been using Django for a few years now and know the ins and outs quite well.

I can see how you'd be enticed by a simpler framework such as webapp2 or Flask as a starting point. But I've found that Django is as flexible if you just consider that most of the built-in features that Django provides (even the awesome ORM) are optional if you know what apps and middleware to disable.


> if you know what apps and middleware to disable.

And when I was learning Django, I didn't know this. I moved to webapp2 because I could put only what I wanted in an application. I'm sure that if I sat down and re-dedicated myself to learning Django like I'm doing with Rails, I might have a better time at it the second go-around.


Yes, I know. It took me a long time to understand Django the way I do today. A great starting point was James Bennett's 'How Django processes a request' blogpost [1]. From there you'll see how Django is just a tiny wrapper calling a bunch of increasingly complex applications that build on top of each other.

There should probably be a chapter on the tutorial with a simplified version of that. It'd help newcomers understand where everything fits.

In any case, I'm glad you found a tool that does what you need as long as it isn't written in PHP :P

[1] http://www.b-list.org/weblog/2006/jun/13/how-django-processe...


Django provides a set of tools and a unique methodology for creating apps. Overall, you end up writing less code in a djnago app in order to do more, for that reason, it requires greater understanding of the framework. For simpler frameworks, they require less understanding but greater amount of code, which may end up being more complicated.

I, personally, used to do it all by myself as a PHP developer, where I wrote raw sql queries and handled the raw HTTP request. Once I figured out ORM in django and its custom templating system, everything becomes so much less code and easy to implement.


So let me get this straight. You didn't like Django because after not taking the time to learn it, you couldn't get it to do what you wanted. So you switched to a very lightweight model (webapp2), and loved the learning curve and flexibility. And then you tried out Rails (about as Django as you can get in terms of steep learning curve and having to contort to do non-traditional things) and loved it.

Nothing in that logic adds up. And for the record, I've yet to do a "traditional" web app in Django. Having taken the time to learn it inside and out I get all the benefits of flexibility that I would with something like Flask/webapp2, but retain the convention and mindshare for the rest of the project that does fit into common usecases.


As I stated in an earlier comment, I would likely have a different experience with Django now. Django was the first framework I attempted to learn, so I'll wholeheartedly admit that some of that was inexperience with web applications (started programming with non-web VB and Java).

I could write much of the same post and have it apply to Django as well. Django is designed to abstract away work, which means that it's difficult to really see what your application should be doing if you don't already know. If you've learned how to manage user authentication manually, you can appreciate and tweak what Django/Rails are doing. If your first experience with a web framework is having Django manage all of that for you, then you have no idea how to tweak it or debug it.

Ultimately, this is not a Django versus Rails debate - I just used my current Rails experience and prior Django experience as anecdote. I can't claim enough knowledge of Django or Rails to even advise someone on which to learn; all I can do is talk about my own experience and raise questions.


I started programming python with webapp2 also, after coming from a php, java, and node.js background. I found it to be a bit more low-level and manual as far as frameworks are concerned, but I discovered that to be enjoyable. While it did force me to write a bit more scaffolding, request, and model/caching code I know that I have a MUCH deeper understanding of the frameworks works as a whole and communicates end-to-end. It might have forced me to do more work initially but I find now that I have a deep knowledge of the framework (not just it's APIs and methods) I am able to iterate faster and stretch and bend the framework to work outside of it's traditional modeling - very much unlike other similar frameworks I have worked with in PHP/node.js


Have you tried any web development with Django? Under some light, it may be helpful to develop an app using webapp2, but normally you want to abstract most of it away. Django has done it very nicely. I encourage you to explore it for it may save you countless hours you may end up spending in future.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: