File: compat.py

package info (click to toggle)
django-oauth-toolkit 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,156 kB
  • sloc: python: 11,100; makefile: 159; javascript: 9; sh: 6
file content (15 lines) | stat: -rw-r--r-- 393 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
The `compat` module provides support for backwards compatibility with older
versions of Django and Python.
"""

try:
    # Django 5.1 introduced LoginRequiredMiddleware, and login_not_required decorator
    from django.contrib.auth.decorators import login_not_required
except ImportError:

    def login_not_required(view_func):
        return view_func


__all__ = ["login_not_required"]