File: compat.py

package info (click to toggle)
django-notification 1.2.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 296 kB
  • sloc: python: 873; makefile: 113
file content (26 lines) | stat: -rw-r--r-- 599 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import django
from django.conf import settings
from django.utils import six


# Django 1.5 add support for custom auth user model
if django.VERSION >= (1, 5):
    AUTH_USER_MODEL = settings.AUTH_USER_MODEL
else:
    AUTH_USER_MODEL = "auth.User"

try:
    from django.contrib.auth import get_user_model
except ImportError:
    from django.contrib.auth.models import User
    get_user_model = lambda: User

try:
    from urllib import quote
except ImportError:
    from urllib.parse import quote  # noqa

if six.PY3:
    from threading import get_ident
else:
    from thread import get_ident  # noqa