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

Flexibility and scalability - those are the two takeaways from this.

I've always found django (for example I'm not specifically down on django) to be quick to get up and running but to lead you gently down a path that ends with a very high brick wall.

Pyramid on the other hand is so flexible that pretty much any part of the framework can be swapped out for something else and you can abstract the important parts of your app into a mini-framework for yourself. An example of this: The code I have <100 lines of code in a file called rest_traversal.py that maps SQLAlchemy mapped tables to urls like:

/db/Model -> all instances of Model /db/Model/1 -> model 1 /db/Model/1/relationship -> all members of model 1's relationship

I'm currently using Pyramid to build the real time front end to an algorithmic trading system and it's been the perfect balance for me.



Not disagreeing with you here, but is it the case that (most) people build on Django expecting it to scale very well later on? I've not built any Django apps that have seen the light of day, but I've always had the impression that once you have something up and running and are now, hopefully, getting some revenue that transitioning to something more scalable would be much less painful. Reason being, the vision was clarified under Django through a number of (hopefully) quick tweaks here and there.

Or does your experience say otherwise? If one were to build something that would need to be immediately scalable, don't even think of Django and head towards something like Pyramid and Flask?


No! Django scales well and scalability is not a very good reason to switch away from Django. Plenty of high volume sites are powered by it, most famously Disqus.


Pinterest is built on Django too.


I actually meant scalability in terms of how your application grows, not how much traffic it can handle in my answer. I should have been clearer.


I remember reading some OSS snippets called something like rest traversal - was that you?

I know that's a bit vague - really I am asking is your hundred lines in the public domain?


It turned out to be a bit more than 100 lines when I added it all up :-)

Here's the bulk of the code in a gist, with a little example of usage:

https://gist.github.com/boothead/5108455

Be happy to answer any questions if it's unclear.

The great thing about pyramid that this code might not really indicate if you're not familiar with it, is that you can attach instances of these traversal classes anywhere in your tree and the views will still do the right thing. Likewise, using the model_is predicate lets you override the default json renderer for specific classes if you need to.




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

Search: