|
23 | 23 | # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
|
24 | 24 |
|
25 | 25 | # SECURITY WARNING: keep the secret key used in production secret!
|
26 |
| -SECRET_KEY = '#9)q!_i3@pr-^3oda(e^3$x!kq3b4f33#5l@+=+&vuz+p6gb3g' |
| 26 | +SECRET_KEY = "#9)q!_i3@pr-^3oda(e^3$x!kq3b4f33#5l@+=+&vuz+p6gb3g" |
27 | 27 |
|
28 | 28 | # SECURITY WARNING: don't run with debug turned on in production!
|
29 | 29 | DEBUG = True
|
30 | 30 |
|
31 |
| -ALLOWED_HOSTS = ['*'] |
| 31 | +ALLOWED_HOSTS = ["*"] |
32 | 32 |
|
33 | 33 |
|
34 | 34 | # Application definition
|
35 | 35 |
|
36 | 36 | INSTALLED_APPS = [
|
37 |
| - 'django.contrib.admin', |
38 |
| - 'django.contrib.auth', |
39 |
| - 'django.contrib.contenttypes', |
40 |
| - 'django.contrib.sessions', |
41 |
| - 'django.contrib.messages', |
42 |
| - 'django.contrib.staticfiles', |
43 |
| - 'test_app', |
44 |
| - 'passkeys', |
45 |
| - 'sslserver' |
| 37 | + "django.contrib.admin", |
| 38 | + "django.contrib.auth", |
| 39 | + "django.contrib.contenttypes", |
| 40 | + "django.contrib.sessions", |
| 41 | + "django.contrib.messages", |
| 42 | + "django.contrib.staticfiles", |
| 43 | + "test_app", |
| 44 | + "passkeys", |
| 45 | + "sslserver", |
46 | 46 | ]
|
47 | 47 |
|
48 | 48 | MIDDLEWARE = [
|
49 |
| - 'django.middleware.security.SecurityMiddleware', |
50 |
| - 'django.contrib.sessions.middleware.SessionMiddleware', |
51 |
| - 'django.middleware.common.CommonMiddleware', |
52 |
| - 'django.middleware.csrf.CsrfViewMiddleware', |
53 |
| - 'django.contrib.auth.middleware.AuthenticationMiddleware', |
54 |
| - 'django.contrib.messages.middleware.MessageMiddleware', |
55 |
| - 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 49 | + "django.middleware.security.SecurityMiddleware", |
| 50 | + "django.contrib.sessions.middleware.SessionMiddleware", |
| 51 | + "django.middleware.common.CommonMiddleware", |
| 52 | + "django.middleware.csrf.CsrfViewMiddleware", |
| 53 | + "django.contrib.auth.middleware.AuthenticationMiddleware", |
| 54 | + "django.contrib.messages.middleware.MessageMiddleware", |
| 55 | + "django.middleware.clickjacking.XFrameOptionsMiddleware", |
56 | 56 | ]
|
57 | 57 |
|
58 |
| -ROOT_URLCONF = 'test_app.urls' |
| 58 | +ROOT_URLCONF = "test_app.urls" |
59 | 59 |
|
60 | 60 | TEMPLATES = [
|
61 | 61 | {
|
62 |
| - 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
63 |
| - 'DIRS': [os.path.join(BASE_DIR ,'example','templates' )], |
64 |
| - 'APP_DIRS': True, |
65 |
| - 'OPTIONS': { |
66 |
| - 'context_processors': [ |
67 |
| - 'django.template.context_processors.debug', |
68 |
| - 'django.template.context_processors.request', |
69 |
| - 'django.contrib.auth.context_processors.auth', |
70 |
| - 'django.contrib.messages.context_processors.messages', |
| 62 | + "BACKEND": "django.template.backends.django.DjangoTemplates", |
| 63 | + "DIRS": [os.path.join(BASE_DIR, "example", "templates")], |
| 64 | + "APP_DIRS": True, |
| 65 | + "OPTIONS": { |
| 66 | + "context_processors": [ |
| 67 | + "django.template.context_processors.debug", |
| 68 | + "django.template.context_processors.request", |
| 69 | + "django.contrib.auth.context_processors.auth", |
| 70 | + "django.contrib.messages.context_processors.messages", |
71 | 71 | ],
|
72 | 72 | },
|
73 | 73 | },
|
74 | 74 | ]
|
75 | 75 |
|
76 |
| -WSGI_APPLICATION = 'test_app.wsgi.application' |
| 76 | +WSGI_APPLICATION = "test_app.wsgi.application" |
77 | 77 |
|
78 | 78 |
|
79 | 79 | # Database
|
80 | 80 | # https://docs.djangoproject.com/en/2.0/ref/settings/#databases
|
81 | 81 |
|
82 | 82 | DATABASES = {
|
83 |
| - 'default': { |
84 |
| - 'ENGINE': 'django.db.backends.sqlite3', |
85 |
| - 'NAME': 'test_db', |
| 83 | + "default": { |
| 84 | + "ENGINE": "django.db.backends.sqlite3", |
| 85 | + "NAME": "test_db", |
86 | 86 | }
|
87 | 87 | }
|
88 | 88 |
|
|
92 | 92 |
|
93 | 93 | AUTH_PASSWORD_VALIDATORS = [
|
94 | 94 | {
|
95 |
| - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
| 95 | + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", |
96 | 96 | },
|
97 | 97 | {
|
98 |
| - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
| 98 | + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", |
99 | 99 | },
|
100 | 100 | {
|
101 |
| - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
| 101 | + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", |
102 | 102 | },
|
103 | 103 | {
|
104 |
| - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
| 104 | + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", |
105 | 105 | },
|
106 | 106 | ]
|
107 | 107 |
|
108 | 108 |
|
109 | 109 | # Internationalization
|
110 | 110 | # https://docs.djangoproject.com/en/2.0/topics/i18n/
|
111 | 111 |
|
112 |
| -LANGUAGE_CODE = 'en-us' |
| 112 | +LANGUAGE_CODE = "en-us" |
113 | 113 |
|
114 |
| -TIME_ZONE = 'UTC' |
| 114 | +TIME_ZONE = "UTC" |
115 | 115 |
|
116 | 116 | USE_I18N = True
|
117 | 117 |
|
|
122 | 122 |
|
123 | 123 | # Static files (CSS, JavaScript, Images)
|
124 | 124 | # https://docs.djangoproject.com/en/2.0/howto/static-files/
|
125 |
| - |
126 |
| -STATIC_URL = '/static/' |
127 |
| -#STATIC_ROOT=(os.path.join(BASE_DIR,'static')) |
128 |
| -STATICFILES_DIRS=[os.path.join(BASE_DIR,'static')] |
129 |
| -LOGIN_URL="/auth/login" |
130 |
| - |
131 |
| -AUTHENTICATION_BACKENDS = ['passkeys.backend.PasskeyModelBackend'] |
132 |
| - |
133 |
| -FIDO_SERVER_ID="localhost" # Server rp id for FIDO2, it the full domain of your project |
134 |
| -FIDO_SERVER_NAME="TestApp" |
| 125 | +USERNAME_FIELD = "email" |
| 126 | +STATIC_URL = "/static/" |
| 127 | +# STATIC_ROOT=(os.path.join(BASE_DIR,'static')) |
| 128 | +STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] |
| 129 | +LOGIN_URL = "/auth/login" |
| 130 | +AUTH_USER_MODEL = "test_app.User" |
| 131 | +AUTHENTICATION_BACKENDS = ( |
| 132 | + "django.contrib.auth.backends.ModelBackend", |
| 133 | + "test_app.backends.EmailBackend", |
| 134 | + "passkeys.backend.PasskeyModelBackend", |
| 135 | +) |
| 136 | + |
| 137 | +FIDO_SERVER_ID = ( |
| 138 | + "localhost" # Server rp id for FIDO2, it the full domain of your project |
| 139 | +) |
| 140 | +FIDO_SERVER_NAME = "TestApp" |
135 | 141 | KEY_ATTACHMENT = None # Set None to allow all authenticator attachment
|
0 commit comments