摄影记录 Django

发布于 2024-09-08 03:07:24 字数 788 浏览 2 评论 0原文

我正在尝试在这里实现 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 的情况下安装它:

http://en.wikipedia.org/wiki /线程本地存储

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:

http://en.wikipedia.org/wiki/Thread-local_storage

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ぽ尐不点ル 2024-09-15 03:07:24

这篇博客文章已有近三年的历史了。从那时起,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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文