Use only some parts of Django?

后端 未结 8 1800
北海茫月
北海茫月 2020-11-28 02:39

I like Django, but for a particular application I would like to use only parts of it, but I\'m not familiar enough with how Django works on the inside, so maybe someone can

相关标签:
8条回答
  • 2020-11-28 03:19

    I tend to prefer a mix-and-match approach to using Python for web programming. :-)

    I don't have a lot of experience with Django, but I'd recommend giving sqlalchemy a look for the database stuff. It works well with others and gives you several potential layers of abstraction (so you can go with something basic or tweak the hell out of it if you want). Plus, you'll already be somewhat familiar with it if you've ever used hibernate/nhibernate.

    My favorite part is that it has a lot of options for databases to connect to (most notably SQL Server, which django doesn't have built in last time I checked).

    With that said, I'm told that with Django, it's pretty easy to decouple functionality (but never done so myself).

    0 讨论(0)
  • 2020-11-28 03:22

    There are of course other projects out there that specifically implement single parts of django. TurboGears for example is a collection of several projects that can work by themselves and together form a complete web development framework.

    For the db abstraction SQLAlchemy comes to mind.

    Regarding the caching part: I'm not aware of any standalone project that implements a generic caching facility.

    On the other hand, it should be fairly easy to implement your own caching, for example by using pickles. Have a look at this recipe for a decorator for ideas and google for "memoize".

    Also keep in mind that your database has its own caching mechanism, so maybe you don't even need to concern yourself with the details.

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