什么是“django 后端”?
我遇到过很多 django 应用程序提到“后端”,但并不确切知道它是什么。一般来说,在 google 上搜索并没有给出太多关于 django 后端的结果。有人可以解释一下吗?
具体来说,请看以下示例:
实际上我认为前两个和第三个有点不同,我更不确定的是前两个:Apps 中包含的后端。
I've been encountering quite a few django Apps mentioning 'backend', but don't exactly know what it is. Searching around google does not give much results regarding django backends in general. Could someone give an explanation?
To be specific, take these examples:
- django.contrib.auth.backends.ModelBackend
- django.contrib.sessions.backends.cache
- "The messages framework can use different backends to store
temporary messages"
Actually I think the first two and the third are a bit different, what I was more unsure about was the first two: backends included in Apps.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
django 附带了一种或多种身份验证、缓存等实现,但该框架预计需要添加您自己的自定义“后端”实现。它们通常提供一个简单且记录良好的界面以及一个设置变量,因此可以轻松插入您自己的自定义模块。
此术语/模式也被常见的 django 应用程序使用,例如 django-registration。
如果您对设计模式感兴趣,此博客提供了一些分析:http://charlesleifer.com/blog/django-patterns -可插入后端/
django comes with one or more implementations of authentication, caching, etc but the framework anticipates the need for adding your own custom "backend" implementation. They generally provide a simple well-documented interface as well as a setting variable so it is easy to plug in your own custom module.
This term/pattern is also used by common django apps such as django-registration.
If you are into design patterns this blog provides some analysis: http://charlesleifer.com/blog/django-patterns-pluggable-backends/