• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

smartfile / django-session-jwt / 4120103744

pending completion
4120103744

Pull #47

github

GitHub
Merge 35e258ac2 into 1a507ba87
Pull Request #47: Bump cryptography from 35.0.0 to 39.0.1

278 of 291 relevant lines covered (95.53%)

26.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/django_session_jwt/settings.py
1
from __future__ import unicode_literals
28✔
2

3
# Django settings for django_session_jwt project.
4

5
DEBUG = True
28✔
6
TEMPLATE_DEBUG = DEBUG
28✔
7

8
ADMINS = (
28✔
9
    # ('Your Name', 'your_email@example.com'),
10
)
11

12
MANAGERS = ADMINS
28✔
13

14
DATABASES = {
28✔
15
    'default': {
16
        'ENGINE': 'django.db.backends.sqlite3',  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
17
        'NAME': ':memory:',                      # Or path to database file if using sqlite3.
18
        'USER': '',                      # Not used with sqlite3.
19
        'PASSWORD': '',                  # Not used with sqlite3.
20
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
21
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
22
    }
23
}
24

25
# Local time zone for this installation. Choices can be found here:
26
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
27
# although not all choices may be available on all operating systems.
28
# In a Windows environment this must be set to your system time zone.
29
TIME_ZONE = 'America/Chicago'
28✔
30

31
# Language code for this installation. All choices can be found here:
32
# http://www.i18nguy.com/unicode/language-identifiers.html
33
LANGUAGE_CODE = 'en-us'
28✔
34

35
SITE_ID = 1
28✔
36

37
# If you set this to False, Django will make some optimizations so as not
38
# to load the internationalization machinery.
39
USE_I18N = True
28✔
40

41
# If you set this to False, Django will not format dates, numbers and
42
# calendars according to the current locale.
43
USE_L10N = True
28✔
44

45
# If you set this to False, Django will not use timezone-aware datetimes.
46
USE_TZ = True
28✔
47

48
# Absolute filesystem path to the directory that will hold user-uploaded files.
49
# Example: "/home/media/media.lawrence.com/media/"
50
MEDIA_ROOT = ''
28✔
51

52
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
53
# trailing slash.
54
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
55
MEDIA_URL = ''
28✔
56

57
# Absolute path to the directory static files should be collected to.
58
# Don't put anything in this directory yourself; store your static files
59
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
60
# Example: "/home/media/media.lawrence.com/static/"
61
STATIC_ROOT = ''
28✔
62

63
# URL prefix for static files.
64
# Example: "http://media.lawrence.com/static/"
65
STATIC_URL = '/static/'
28✔
66

67
# Make this unique, and don't share it with anybody.
68
SECRET_KEY = '8ij$(7l2!w0f8kggntbv=+$bd=^2xs$cl+3v^_##qjw@2py9_3'
28✔
69

70
# List of callables that know how to import templates from various sources.
71
TEMPLATE_LOADERS = (
28✔
72
    'django.template.loaders.filesystem.Loader',
73
    'django.template.loaders.app_directories.Loader',
74
    # 'django.template.loaders.eggs.Loader',
75
)
76

77
MIDDLEWARE = (
28✔
78
    'django.middleware.common.CommonMiddleware',
79
    'django_session_jwt.middleware.SessionMiddleware',
80
    'django.middleware.csrf.CsrfViewMiddleware',
81
    'django.contrib.auth.middleware.AuthenticationMiddleware',
82
    'django.contrib.messages.middleware.MessageMiddleware',
83
)
84

85
# For older Django versions
86
MIDDLEWARE_CLASSES = MIDDLEWARE
28✔
87

88
ROOT_URLCONF = 'django_session_jwt.urls'
28✔
89

90
# Python dotted path to the WSGI application used by Django's runserver.
91
WSGI_APPLICATION = 'django_session_jwt.wsgi.application'
28✔
92

93
TEMPLATE_DIRS = (
28✔
94
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
95
    # Always use forward slashes, even on Windows.
96
    # Don't forget to use absolute paths, not relative paths.
97
)
98

99
INSTALLED_APPS = (
28✔
100
    'django.contrib.auth',
101
    'django.contrib.contenttypes',
102
    'django.contrib.sessions',
103
    'django.contrib.sites',
104
    'django.contrib.messages',
105
    'django_session_jwt',
106
)
107

108
DJANGO_SESSION_JWT = {
28✔
109
    # FIELDS should consist of tuples of (attrname, sname, lname) where:
110
    # - attrname is the name of a user object attribute. This can reference a
111
    #   nested object by using periods: related_object.attribute_name.
112
    # - sname is the short form of this name, ideally a single char (unique).
113
    #   this form is used within the JWT itself and should be short to reduce
114
    #   storage.
115
    # - lname is the long form of the name. This is the name that can be used
116
    #   to access this value after the JWT is verified.
117
    'FIELDS': [
118
        ('id', 'id', 'user_id'),
119
        ('username', 'u', 'username'),
120
        ('email', 'e', 'email'),
121
        ('invalid', 'i', 'invalid'),
122
    ],
123
    'CALLABLE': 'django_session_jwt.get_fields',
124
    'KEY': SECRET_KEY,
125
    # The default, uncomment to override:
126
    # 'SESSION_FIELD': 'sk',
127
    'EXPIRES': 60 * 60 * 8,
128
}
129

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc