摄影记录 Django
我正在尝试在这里实现 photologue django 照片库:
http://skam.webfactional.com/blog/2007/08/08/django-based-photo-gallery-tutorial/
我不明白这部分:
您需要在外部获取当前用户的信息请求,查看 CookBookThreadlocalsAndUser 并在“MIDDLEWARE_CLASSES”设置中添加中间件。
这里是 CookBookThreadlocalsandUser 的链接:
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
什么我必须安装中间件吗? Threadlocals到底是什么? 是否可以在不完全理解 Threadlocals 的情况下安装它:
I am trying to implement the photologue django photo gallery here:
http://skam.webfactional.com/blog/2007/08/08/django-based-photo-gallery-tutorial/
I dont understand this part:
You need to have the current user’s info outside requests, have a look at CookBookThreadlocalsAndUser and add the middleware in your “MIDDLEWARE_CLASSES” settings.
Here the Link to CookBookThreadlocalsandUser:
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
What Middleware do I have to install?
What exactly is Threadlocals?
Is it possible to install this without fully understanding Threadlocals:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这篇博客文章已有近三年的历史了。从那时起,Django 已经取得了长足的进步,而 threadlocals(它只不过是一种黑客行为)现在受到了官方警告。
这并不是该教程中唯一过时的内容 - 所有对 admin 的引用现在也完全错误。
然而,该教程似乎与 photologue 没有任何关系 - 它描述了如何构建您自己的自定义图库。您为什么不看看实际的 Photologue 文档,它看起来非常全面?
That blog entry is nearly three years old. Django has moved on considerably since then, and threadlocals - which was never anything more than a hack - is now officially warned against.
That's not the only thing that is out of date in that tutorial - all the references to admin are also now completely wrong.
However, that tutorial does not seem to have anything to do with photologue - it's a description of how to build your own custom gallery. Why don't you look at the actual Photologue documentation which appears to be very comprehensive?