来自自动化源的 Django 身份验证
我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否考虑过使用Celery? Celery 与 Django 无缝协作。这将使您可以使用与项目其余部分相同的身份验证机制定期运行作业。您还可以通过避免
urllib2
使事情变得更加统一。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
.