推荐学习书目
› 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 · Nov 9, 2017 · 3505 views
    This topic created in 3244 days ago, the information mentioned may be changed or developed.

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

    谢谢!

    3 replies  •  2017-11-10 15:56:34 +08:00
    zhuf
        2
    zhuf  
       Nov 9, 2017
    authentication_classes,permission_classes 里面自定义
    ccmao755
        3
    ccmao755  
    OP
       Nov 10, 2017
    这个知道, 但是如何统一拦截 请求? 还是需要在 view 方法中写注释,太麻烦了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5511 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 02:50 · PVG 10:50 · LAX 19:50 · JFK 22:50
    ♥ Do have faith in what you're doing.