221 lines
5.8 KiB
Python
221 lines
5.8 KiB
Python
"""
|
|
Django settings for NorahUniversity project.
|
|
|
|
Generated by 'django-admin startproject' using Django 5.2.1.
|
|
|
|
For more information on this file, see
|
|
https://docs.djangoproject.com/en/5.2/topics/settings/
|
|
|
|
For the full list of settings and their values, see
|
|
https://docs.djangoproject.com/en/5.2/ref/settings/
|
|
"""
|
|
import os
|
|
from pathlib import Path
|
|
from django.templatetags.static import static
|
|
|
|
# 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.2/howto/deployment/checklist/
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
SECRET_KEY = 'django-insecure-_!ew&)1&r--3h17knd27^x8(xu(&-f4q3%x543lv5vx2!784s*'
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
DEBUG = True
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
# Application definition
|
|
|
|
INSTALLED_APPS = [
|
|
'django.contrib.admin',
|
|
'django.contrib.humanize',
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.messages',
|
|
'django.contrib.staticfiles',
|
|
'rest_framework',
|
|
'recruitment.apps.RecruitmentConfig',
|
|
'corsheaders',
|
|
'django.contrib.sites',
|
|
'allauth',
|
|
'allauth.account',
|
|
'allauth.socialaccount',
|
|
'allauth.socialaccount.providers.linkedin_oauth2',
|
|
'channels',
|
|
'django_filters',
|
|
'crispy_forms',
|
|
'django_summernote',
|
|
'crispy_bootstrap5',
|
|
'django_extensions',
|
|
'template_partials',
|
|
'django_countries',
|
|
'django_celery_results'
|
|
]
|
|
|
|
SITE_ID = 1
|
|
|
|
AUTHENTICATION_BACKENDS = [
|
|
'django.contrib.auth.backends.ModelBackend',
|
|
'allauth.account.auth_backends.AuthenticationBackend',
|
|
]
|
|
|
|
MIDDLEWARE = [
|
|
'corsheaders.middleware.CorsMiddleware',
|
|
'django.middleware.security.SecurityMiddleware',
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
'allauth.account.middleware.AccountMiddleware',
|
|
]
|
|
|
|
ROOT_URLCONF = 'NorahUniversity.urls'
|
|
|
|
CORS_ALLOW_ALL_ORIGINS = True
|
|
|
|
ASGI_APPLICATION = 'hospital_recruitment.asgi.application'
|
|
CHANNEL_LAYERS = {
|
|
'default': {
|
|
'BACKEND': 'channels_redis.core.RedisChannelLayer',
|
|
'CONFIG': {
|
|
'hosts': [('127.0.0.1', 6379)],
|
|
},
|
|
},
|
|
}
|
|
|
|
TEMPLATES = [
|
|
{
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
'DIRS': [os.path.join(BASE_DIR, 'templates')],
|
|
'APP_DIRS': True,
|
|
'OPTIONS': {
|
|
'context_processors': [
|
|
'django.template.context_processors.request',
|
|
'django.contrib.auth.context_processors.auth',
|
|
'django.contrib.messages.context_processors.messages',
|
|
],
|
|
},
|
|
},
|
|
]
|
|
|
|
WSGI_APPLICATION = 'NorahUniversity.wsgi.application'
|
|
|
|
# Database
|
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': BASE_DIR / 'db.sqlite3',
|
|
}
|
|
}
|
|
|
|
# Password validation
|
|
# https://docs.djangoproject.com/en/5.2/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',
|
|
},
|
|
]
|
|
|
|
# Crispy Forms Configuration
|
|
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
|
|
CRISPY_TEMPLATE_PACK = "bootstrap5"
|
|
|
|
# Bootstrap 5 Configuration
|
|
CRISPY_BS5 = {
|
|
'include_placeholder_text': True,
|
|
'use_css_helpers': True,
|
|
}
|
|
|
|
# Internationalization
|
|
# https://docs.djangoproject.com/en/5.2/topics/i18n/
|
|
|
|
LANGUAGES = [
|
|
('en', 'English'),
|
|
('ar', 'Arabic'),
|
|
]
|
|
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
LOCALE_PATHS = [
|
|
BASE_DIR / 'locale',
|
|
]
|
|
|
|
TIME_ZONE = 'Asia/Riyadh'
|
|
|
|
USE_I18N = True
|
|
|
|
USE_TZ = True
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
# https://docs.djangoproject.com/en/5.2/howto/static-files/
|
|
|
|
STATIC_URL = '/static/'
|
|
MEDIA_URL = '/media/'
|
|
STATICFILES_DIRS = [
|
|
BASE_DIR / 'static'
|
|
]
|
|
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'static/media')
|
|
|
|
# Default primary key field type
|
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
|
|
|
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|
|
|
# LinkedIn OAuth Config
|
|
SOCIALACCOUNT_PROVIDERS = {
|
|
'linkedin_oauth2': {
|
|
'SCOPE': [
|
|
'r_liteprofile', 'r_emailaddress', 'w_member_social',
|
|
'rw_organization_admin', 'w_organization_social'
|
|
],
|
|
'PROFILE_FIELDS': [
|
|
'id', 'first-name', 'last-name', 'email-address'
|
|
]
|
|
}
|
|
}
|
|
|
|
|
|
ZOOM_ACCOUNT_ID = 'HoGikHXsQB2GNDC5Rvyw9A'
|
|
ZOOM_CLIENT_ID = 'brC39920R8C8azfudUaQgA'
|
|
ZOOM_CLIENT_SECRET = 'rvfhjlbID4ychXPOvZ2lYsoAC0B0Ny2L'
|
|
SECRET_TOKEN = '6KdTGyF0SSCSL_V4Xa34aw'
|
|
|
|
# Maximum file upload size (in bytes)
|
|
DATA_UPLOAD_MAX_MEMORY_SIZE = 10485760 # 10MB
|
|
FILE_UPLOAD_MAX_MEMORY_SIZE = 10485760 # 10MB
|
|
|
|
CORS_ALLOW_CREDENTIALS = True
|
|
|
|
CELERY_BROKER_URL = 'redis://localhost:6379/0' # Or your message broker URL
|
|
CELERY_RESULT_BACKEND = 'django-db' # If using django-celery-results
|
|
CELERY_ACCEPT_CONTENT = ['application/json']
|
|
CELERY_TASK_SERIALIZER = 'json'
|
|
CELERY_RESULT_SERIALIZER = 'json'
|
|
CELERY_TIMEZONE = 'UTC'
|
|
|
|
|
|
LINKEDIN_CLIENT_ID = '867jwsiyem1504'
|
|
LINKEDIN_CLIENT_SECRET = 'WPL_AP1.QNH5lYnfRSQpp0Qp.GO8Srw=='
|
|
LINKEDIN_REDIRECT_URI = 'http://127.0.0.1:8000/jobs/linkedin/callback/' |