来自自动化源的 Django 身份验证

发布于 2024-09-26 03:00:08 字数 236 浏览 3 评论 0原文

我的 django 应用程序中有一组触发某些操作或进程的 URL。这类似于 cron 作业。我有一个脚本,可以定期轮询这些 URL 中的一个或多个,并且我有兴趣添加一层安全性。

我想为脚本设置一个帐户,并在执行进程之前要求进行身份验证。我一直在阅读 Django 用户身份验证文档以及 python 的 urllib2 库,但我有点迷失了。我对如何做到这一点有一些想法,但我在这样的安全方面没有很多经验。

有推荐的阅读材料吗?

I have a set of URL's in my django application that trigger certain actions or processes. This would be similar to cron jobs. I have a script that polls one or more of these URLS at some regular inverval and I'm interested in adding a layer of security.

I'd like to set up an account for the script and require authentication before the proccesses would execute. I've been reading around in the Django user authentication documentation, along with python's urllib2 library and I'm just a bit lost. I have some ideas of how this might be done, but I dont' have a lot of experience in security like this.

Any suggested reading materials?

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

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

发布评论

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

评论(1

宁愿没拥抱 2024-10-03 03:00:08

我有一个脚本,可以定期轮询这些 URL 中的一个或多个,并且我有兴趣添加一层安全性。

您是否考虑过使用Celery? Celery 与 Django 无缝协作。这将使您可以使用与项目其余部分相同的身份验证机制定期运行作业。您还可以通过避免 urllib2 使事情变得更加统一

I have a script that polls one or more of these URLS at some regular inverval and I'm interested in adding a layer of security.

Have you considered using Celery? Celery works seamlessly with Django. This will let you periodically run jobs using the same authentication mechanism as the rest of the project. You can also make things a bit more uniform by avoiding urllib2.

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