Sorry, I mean the I added it and tried, but same thing happened to So Commented it out (because I do not have any custom auth backends so no need to add it)
Auth User model :
AUTH_USER_MODEL = 'UserManagementSystem.CustomUser'
My settings .py:
"""
Django settings for ArogyaX project.
Generated by 'django-admin startproject' using Django 5.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/5.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/
"""
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '-------------------------------------'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = [
'*'
]
SITE_DOMAIN = 'http://127.0.0.1:8000'
# DEBUG = True
# ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'daphne',
'channels',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
EXTERNAL_APPS = [
'crispy_forms',
'compressor',
'django_browser_reload',
'comm_missl.apps.CommMisslConfig',
'ClientManagementSystem.apps.ClientmanagementsystemConfig',
'ImagingRecordKeepingSystem.apps.ImagingrecordkeepingsystemConfig',
'LaboratoryManagementSystem.apps.LaboratorymanagementsystemConfig',
'PharmacyManagementSystem.apps.PharmacymanagementsystemConfig',
'InventoryManagementSystem.apps.InventorymanagementsystemConfig',
'HumanResourceManagementSystem.apps.HumanresourcemanagementsystemConfig',
'AppointmentSchedulingSystem.apps.AppointmentschedulingsystemConfig',
'TelemedicineSystem.apps.TelemedicinesystemConfig',
'BillingManagementSystem.apps.BillingmanagementsystemConfig',
'UserManagementSystem.apps.UsermanagementsystemConfig',
]
NPM_BIN_PATH = '/home/samdam82/.nvm/versions/node/v22.15.0/bin/npm'
INSTALLED_APPS += EXTERNAL_APPS
INTERNAL_IPS = [
'127.0.0.1',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
"django_browser_reload.middleware.BrowserReloadMiddleware",
]
TEMPLATES_DIR = os.path.join(BASE_DIR,'templates')
ROOT_URLCONF = 'ArogyaX.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR/ "templates"],
# 'DIRS': [TEMPLATES_DIR], # for template dir on root
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'ArogyaX.context_processors.navbar_items',
'ArogyaX.context_processors.client_navbar_items',
],
},
},
]
# WSGI_APPLICATION = 'ArogyaX.wsgi.application'
ASGI_APPLICATION = 'ArogyaX.asgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'arogyax',
'USER':'root',
'PASSWORD':'----------',
'PORT':3306,
'HOST': '127.0.0.1',
}
}
# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
]
# Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
# USE_TZ = False
USE_TZ = True
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
DATE_INPUT_FORMATS = ['%d/%m/%Y']
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
CRISPY_TEMPLATE_PACK = "bootstrap5"
# we can also add multiple path like [STATIC_DIR,"Some_path1",Some_path2]
STATIC_URL = '/static/' # what will be url path for static files to show on template side.
# STATIC_URL Needed for both root static folder (using static folder or root directory) and app static folder (static folder inside app)
STATICFILES_DIRS = [BASE_DIR / 'theme' / 'static']
AUTH_USER_MODEL = 'UserManagementSystem.CustomUser'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("127.0.0.1", 6379)],
},
},
}
COMPRESS_ROOT = BASE_DIR / 'static'
COMPRESS_ENABLED = True
# STATICFILES_FINDERS = ('compressor.finders.CompressorFinder',)
STATICFILES_FINDERS = (
"django.contrib.staticfiles.finders.FileSystemFinder", # for django builtin static files like for admin etc
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
"compressor.finders.CompressorFinder",
)
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = '00000000000000'
EMAIL_PORT = 465 # Integer, not string
EMAIL_USE_SSL = True # Use SSL, not TLS
EMAIL_USE_TLS = False
EMAIL_HOST_USER = '----------'
EMAIL_HOST_PASSWORD = '----------'
PASSWORD_RESET_TIMEOUT = 3600 * 24 # for one day