[Fixed]-◈ LoginRequired for the view 💈 Django 1.8

1👍

You can use official django login_required method.

from django.contrib.auth.decorators import login_required

class SomeClassView(View):

    @classmethod
    def as_view(cls, **initkwargs):
        view = super(SomeClassView, cls).as_view(**initkwargs)
        return login_required(view)

Documentation: https://docs.djangoproject.com/en/1.8/topics/auth/default/#the-login-required-decorator

0👍

Yes, this is the same library. The ReadTheDocs link that you posted links directly to the brack3t/django-braces page linked in your question.

Regarding versioning, here is the statement from the Readme.md file:

Our policy going forward is that django-braces officially supports the current version of Django and one version each direction (e.g. 1.6.x is current, so 1.5.x, 1.6.x, and 1.7.x are all supported). There won’t be any restraints on using other versions of Django, though, but it will be a “buyer beware” situation.

According to the repo’s releases page, v1.8 is current, so it should support Django 1.7.x, 1.8.x, and 1.9.x under the current release.

Leave a comment