V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ccmao755
V2EX  ›  Python

关于 django 的权限

  •  
  •   ccmao755 · 2017-11-09 17:32:56 +08:00 · 2264 次点击
    这是一个创建于 2359 天前的主题,其中的信息可能已经有所发展或是发生改变。

    请教大家两个问题,在 django 中 1、admin 和 generic view 是否用的比例不多 2、企业内信息管理系统,大家如何做权限控制?是否有类似 apache shiro 这样的成熟框架实现 url、button 等资源的权限控制? 我大概看了一下 django doc 上关于权限的描述,基本基于 view 中方法的,用 @ 注释去要求认证和授权,这样一个一个写不是太麻烦了?

    谢谢!

    3 条回复    2017-11-10 15:56:34 +08:00
    zhuf
        2
    zhuf  
       2017-11-09 22:07:32 +08:00
    authentication_classes,permission_classes 里面自定义
    ccmao755
        3
    ccmao755  
    OP
       2017-11-10 15:56:34 +08:00
    这个知道, 但是如何统一拦截 请求? 还是需要在 view 方法中写注释,太麻烦了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1375 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:45 · PVG 07:45 · LAX 16:45 · JFK 19:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.