updated authentication

This commit is contained in:
puckoprutt 2025-02-18 20:54:35 +01:00
parent 65140a146e
commit c4ae82a692

View File

@ -61,7 +61,8 @@ INSTALLED_APPS = [
'knox', 'knox',
# my shit # my shit
'user' 'options',
'users'
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@ -101,14 +102,14 @@ REST_FRAMEWORK = {
"rest_framework.authentication.SessionAuthentication" "rest_framework.authentication.SessionAuthentication"
], ],
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
'DEFAULT_PAGINATION_CLASS': 'puckodjango.rest.pagination.MediumPagination', 'DEFAULT_PAGINATION_CLASS': 'settings.puckignation.MediumPagination',
'PAGE_SIZE': 10 'PAGE_SIZE': 10
} }
# DRF-Spectacular # DRF-Spectacular
SPECTACULAR_SETTINGS = { SPECTACULAR_SETTINGS = {
"TITLE": "Puckoprutt Pathfinder API", "TITLE": "Puckoprutt API",
"DESCRIPTION": "A interactive web API for pathfinder stuffs and giggles.", "DESCRIPTION": "A interactive web API for stuffs and giggles.",
"VERSION": "0.1.0", "VERSION": "0.1.0",
"SERVE_PUBLIC": False, "SERVE_PUBLIC": False,
"SERVE_INCLUDE_SCHEMA": False, "SERVE_INCLUDE_SCHEMA": False,
@ -129,7 +130,7 @@ REST_KNOX = {
"SECURE_HASH_ALGORITHM": "hashlib.sha3_512", "SECURE_HASH_ALGORITHM": "hashlib.sha3_512",
"AUTH_TOKEN_CHARACTER_LENGTH": 64, "AUTH_TOKEN_CHARACTER_LENGTH": 64,
"TOKEN_TTL": timedelta(days=4, hours=12), "TOKEN_TTL": timedelta(days=4, hours=12),
"USER_SERIALIZER": "puckodjango.rest.users.serializer.Pucko_User_Serializer", "USER_SERIALIZER": "users.serializer.Pucko_User_Serializer",
"TOKEN_LIMIT_PER_USER": 3, "TOKEN_LIMIT_PER_USER": 3,
"AUTO_REFRESH": False, "AUTO_REFRESH": False,
"AUTO_REFRESH_MAX_TTL": None, "AUTO_REFRESH_MAX_TTL": None,
@ -177,10 +178,12 @@ WSGI_APPLICATION = 'settings.wsgi.application'
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3', 'NAME': BASE_DIR / 'puckoprutt.sqlite3',
} }
} }
# Standard user model
AUTH_USER_MODEL = "users.Puckopruttis"
# Password validation # Password validation
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators