Django: How can I apply the login_required decorator to my entire site (excluding static media)?

前端 未结 10 2022
日久生厌
日久生厌 2020-12-24 07:21

The example provides a snippet for an application level view, but what if I have lots of different (and some non-application) entries in my \"urls.py\" file, including templ

10条回答
  •  没有蜡笔的小新
    2020-12-24 07:57

    For those who have come by later to this, you might find that django-stronghold fits your usecase well. You whitelist any urls you want to be public, the rest are login required.

    https://github.com/mgrouchy/django-stronghold

提交回复
热议问题