I hope that Alberto can enlighten us with more of his technical knowledge.
But, let's start here and now.
Am 27.09.2011 um 13:41 schrieb Jeroen Dierckx:
> Hi all,
>
> I started an email conversation with Michael, but i decided this might
> be useful for others too ...
> Blame gmail for the top posts.
> ---
> Dear Michael,
> Thanks for your opinions!
>
> Can i conclude that you see Flask more as a means to serve as enduser
> frontend, co-existing with Rum/Pyramid as an administration backend?
Flask/Pyramid/Werkzeug/Pylons/TurboGears/Grok or any WSGI compatible framework can be used
for the end user frontend and they can share their user identification with rum and other small things that matter.
Personally, I mount my rum application in a Pylons application.
>
>
> I don't have any experience with Pylons or Pyramid. But at first
> sight, Pyramid does not really have an advantage over Flask in context
> of my intentions imho. The (traditional) routing mechanism seems
> fairly similar.
Pyramid supports traversal + routes.
Well, from my perspective, I had already trouble enough with
the performance of the routes mechanism from Pylons.
Since you asked for routing example, I have to point you to code
where Alberto wrote:
# XXX: the router is kind of messy, should be cleaned up sometime and
# optimized in the future since it's a very hot path
https://bitbucket.org/albertov/rum/src/79d0d92a30a1/rum/router.py
Look at the resource function.
This is called for every resource/class.
It registers some routes for each.
The implementation follows the guidelines from
https://routes.groovie.org/restful.html
Depending on the complexity of your model, the number of routes can grow
quite much.
For a small application, performance was okay, but for a more complex, I got
5000-10000 routes which were processed almost linearly.
I rewrote the router and now it looks like that:
https://bitbucket.org/albertov/rum/src/45d33dc27542/rum/router.py
I am not to happy with it in terms of clarity, but at least the performance is
okay.
Moreover the number of routes is constant with 64=2^6 which is okay for performance now,
but on the other hand, I have the fear that with more requirements at some time the exponent might increase.
> I hadn't seen the Traversal mechanism before, but it
> seems a bit outdated and not very flexible ... It could be fast to
> develop because it's more compact, but harder to debug and manipulate,
> isn't it?
You might want to have a look at:
http://blip.tv/pycon-us-videos-2009-2010-2011/the-big-f-ing-tutorial-development-using-the-repoze-bfg-web-framework-part-001-2011260
>
> I like the fact that Flask is simple and doesn't get in my way, i
> don't consider it *too* simple though. I chose it, because i didn't
> mind doing some "ground-work" because my understanding of the system
> as a whole would be better.
> (Keep in mind that i still consider myself
> a student of Python and software design concepts in general, i do not
> have an academic background).
>
> I probably need to study Pyramid some more, though my time is very
> limited so it'll set back development.
> Maybe i'll keep on prototyping for a while to learn more about where
> this is going and what exactly is needed.
I like this attitude :-), I would do that myself.
I wish you a nice day and hope that you have also nice weather in Belgium (it's really a nice autumn day here).
Best regards,
Michael
>
> So for the sake of the prototype, do you have routing examples for Rum
> that i could try (to convert for use) in Flask?
>
> Any insights and motivations are very welcome! ( eager to learn :) )
>
> Best regards,
> Jeroen
>
>
>
-------------------------------------------
Dr. rer. nat. Michael Brickenstein
Mathematisches Forschungsinstitut Oberwolfach gGmbH
Schwarzwaldstr. 9 - 11
77709 Oberwolfach
Tel.: 07834/979-31
Fax: 07834/979-38