Cappuccino, Django, AJAX, and fitting it all together - review my architecture!

后端 未结 1 453
终归单人心
终归单人心 2021-02-09 20:50

I\'m trying to get my head around Cappuccino. I\'d like my StackOverview peers to review the architecture below and see if it makes sense - the aim is to utilize the unique bene

1条回答
  •  野性不改
    2021-02-09 21:09

    For a low traffic site, using Django's routing layer would be fine, but if you plan on getting a significant amount of traffic, you might consider having your proxying webserver handle the stubs.

    As for the rest, it works and the TurboGears community has been doing it for years (I was a TG committer so that's what I normally use). The TG architecture of returning a dictionary to a template makes this trivial since you just set 'json' as your template engine.

    Doing the same thing in Django isn't much more complicated. Just use the serialization tools to write the result to the response rather than using the templating calls.

    Note that when you do an architecture like this, it's considerably easier to manage if you keep all the application logic in one place. Putting some app logic in Django and some in the browser causes things to start getting messy fairly quickly. If you treat your server as a dumb persistence layer (with the exception of validation/authentication/authorization), life is easier.

    FWIW, I find Sproutcore to be easier to work with than Cappuccino if you're interested in heavier non-progressive enhancement frameworks.

    0 讨论(0)
提交回复
热议问题