Advertisement
Kool_Cool

settings.py

Aug 20th, 2024
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 9.00 KB | None | 0 0
  1. """
  2. Django settings for AtsERP project.
  3.  
  4. Generated by 'django-admin startproject' using Django 3.0.8.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/3.0/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/3.0/ref/settings/
  11. """
  12.  
  13. import os
  14.  
  15. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  16. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  17.  
  18.  
  19. # Quick-start development settings - unsuitable for production
  20. # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
  21.  
  22. # SECURITY WARNING: keep the secret key used in production secret!
  23. SECRET_KEY = '!h#=tt#%_0ih1c_^9#k%#e5tdjk*b1j3t6tn5pe$w_-ay9!a70'
  24.  
  25. # SECURITY WARNING: don't run with debug turned on in production!
  26. DEBUG = True
  27.  
  28. ALLOWED_HOSTS = ['synapsys.adityatrading.in','synapsys.adityatrading.com','192.168.10.41',' 10.212.134.201','ipo.adityatrading.in','trading.adityatrading.in','synapses.adityatrading.in','axon.adityatrading.in','180.179.67.8', 'localhost']
  29.  
  30. # MODE = "SERVER"
  31. MODE = "LOCAL"
  32.  
  33. if MODE == "SERVER":
  34.     FILE_SPLIT = "/"
  35. else:
  36.     FILE_SPLIT = "\\"
  37.  
  38. # Application definition
  39.  
  40. INSTALLED_APPS = [
  41.     'dal',
  42.     'dal_select2',
  43.     'whitenoise.runserver_nostatic',
  44.     'django.contrib.admin',
  45.     'django.contrib.auth',
  46.     'django.contrib.contenttypes',
  47.     'django.contrib.sessions',
  48.     'django.contrib.messages',
  49.     'django.contrib.staticfiles',
  50.     'django_extensions',
  51.     'django_filters',
  52.     'AtsERP.atserp_base',
  53.     'import_export',
  54.     'AtsERP.atserp_base.atserp_workflow.activflow.core',
  55.     'AtsERP.atserp_base.atserp_workflow.activflow',
  56.     'AtsERP.atserp_base.atserp_workflow',
  57.     'rest_framework',
  58.     'rest_framework.authtoken',
  59.     'drf_multiple_model',
  60.     'corsheaders',
  61.     'django_admin_inline_paginator',
  62.    
  63. ]
  64.  
  65. MIDDLEWARE = [
  66.     'django.middleware.security.SecurityMiddleware',
  67.     'whitenoise.middleware.WhiteNoiseMiddleware',
  68.     'django.contrib.sessions.middleware.SessionMiddleware',
  69.     'corsheaders.middleware.CorsMiddleware',
  70.     'django.middleware.common.CommonMiddleware',
  71.     # 'django.middleware.csrf.CsrfViewMiddleware',
  72.     'django.middleware.http.ConditionalGetMiddleware',
  73.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  74.     'django.contrib.messages.middleware.MessageMiddleware',
  75.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  76. ]
  77.  
  78. ROOT_URLCONF = 'AtsERP.urls'
  79. LOGIN_URL = '/admin/login/'
  80. LOGIN_REDIRECT_URL = '/dashboard/'
  81. LOGOUT_REDIRECT_URL = '/admin/login/'
  82.  
  83. TEMPLATES = [
  84.     {
  85.         'BACKEND': 'django.template.backends.django.DjangoTemplates',
  86.         'DIRS': [os.path.join(BASE_DIR, 'AtsERP/atserp_base/templates')],
  87.         'APP_DIRS': True,
  88.         'OPTIONS': {
  89.             'context_processors': [
  90.                 'django.template.context_processors.i18n',
  91.                 'django.template.context_processors.media',
  92.                 'django.template.context_processors.static',
  93.                 'django.template.context_processors.tz',
  94.                 'django.template.context_processors.debug',
  95.                 'django.template.context_processors.request',
  96.                 'django.contrib.auth.context_processors.auth',
  97.                 'django.contrib.messages.context_processors.messages',
  98.                 'AtsERP.atserp_base.atserp_workflow.activflow.core.processors.global_context',
  99.                 'AtsERP.atserp_base.atserp_processors.atserp_request_processor.get_org_units',
  100.             ],
  101.         },
  102.     },
  103. ]
  104.  
  105. WSGI_APPLICATION = 'AtsERP.wsgi.application'
  106.  
  107. LOGGING = {
  108.     'version': 1,
  109.     'disable_existing_loggers': False,
  110.     'formatters': {
  111.         'console': {
  112.             'format': '%(name)-12s %(levelname)-8s %(message)s'
  113.         },
  114.         'verbose': {
  115.             'format': '%(asctime)s %(filename)-12s:%(lineno)s-%(funcName)20s() ::  %(message)s'
  116.         }
  117.     },
  118.     'handlers': {
  119.          'logfile': {
  120.              'level': 'DEBUG',
  121.              'class': 'logging.FileHandler',
  122.              'filename': os.path.join(BASE_DIR, 'log/debug.log'),
  123.              'formatter': 'verbose',
  124.              'mode':'w',
  125.          }
  126.     },
  127.     'loggers': {
  128.          'atslog': {
  129.              'handlers': ['logfile'],
  130.              'level': 'DEBUG',
  131.              'propagate': True,
  132.          }
  133.     }
  134.  }
  135.  
  136. CORS_ORIGIN_ALLOW_ALL = True
  137. CORS_ORIGIN_WHITELIST = (
  138.     'http://localhost:8081','https://testupi.adityatrading.in','https://axon.adityatrading.in',
  139. )
  140.  
  141. REST_FRAMEWORK = {
  142.     'DEFAULT_AUTHENTICATION_CLASSES': [
  143.         'rest_framework.authentication.TokenAuthentication',
  144.     ],
  145. }
  146.  
  147. # Database
  148. # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
  149. # if os.getenv('GAE_APPLICATION', None):
  150. DATABASES = {
  151.         'default': {
  152.             'ENGINE': 'django.db.backends.postgresql_psycopg2',
  153.             'NAME': 'atserptestdb170724',
  154.             'USER': 'postgres',
  155.             'PASSWORD': 'ats123456',
  156.             # https://console.cloud.google.com/sql/instances
  157.             # 'HOST': '/cloudsql/atserp-01:us-central1:pgatserp-01',
  158.             # 'HOST': '35.238.51.157',
  159.             'HOST':'192.168.10.11',
  160.             'PORT': '5432', #at the moment of this writing google cloud postgresql is using the default postgresql port 5432
  161.             # 'OPTIONS': {
  162.             #     'sslmode': 'verify-ca', #leave this line intact
  163.             #     'sslrootcert': '/your/path/to/server-ca.pem',
  164.             #     "sslcert": "/your/path/to/client-cert.pem",
  165.             #     "sslkey": "/your/path/to/client-key.pem",
  166.             # }
  167.         }
  168.     }
  169. # else:
  170. # DATABASES = {
  171. #         'default': {
  172. #             'ENGINE': 'django.db.backends.postgresql_psycopg2',
  173. #             'NAME': 'AtsERP_DB_03',
  174. #             'USER': 'postgres',
  175. #             'PASSWORD': 'synapses',
  176. #             'HOST': 'localhost',
  177. #             'PORT': '5432',
  178. #         }
  179. #     }
  180. # DATABASES = {
  181. #     'default': {
  182. #         'ENGINE': 'django.db.backends.sqlite3',
  183. #         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  184. #     }
  185. # }
  186.  
  187.  
  188. # Password validation
  189. # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
  190.  
  191. AUTH_PASSWORD_VALIDATORS = [
  192.     {
  193.         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  194.     },
  195.     {
  196.         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  197.     },
  198.     {
  199.         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  200.     },
  201.     {
  202.         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  203.     },
  204. ]
  205.  
  206.  
  207. # Internationalization
  208. # https://docs.djangoproject.com/en/3.0/topics/i18n/
  209.  
  210. # LANGUAGE_CODE = 'en-us'
  211.  
  212. # TIME_ZONE = 'UTC'
  213.  
  214. # USE_I18N = True
  215.  
  216. # USE_L10N = True
  217.  
  218. # USE_TZ = True
  219.  
  220. LANGUAGE_CODE = 'en-us'
  221.  
  222. TIME_ZONE = 'Asia/Kolkata'
  223.  
  224. USE_I18N = False
  225.  
  226. USE_L10N = False
  227.  
  228. # Static files (CSS, JavaScript, Images)
  229. # https://docs.djangoproject.com/en/3.0/howto/static-files/
  230.  
  231. CDAS_MOCK_URL_AUTH = 'http://mockweb.cdslindia.com/AuthWeb/api/CDASAuthorization/APIAuth'
  232. CDAS_MOCK_URL_BOSETUP = 'http://mockweb.cdslindia.com/Commonweb/api/BOAPI/BOSetup'
  233.  
  234. CDAS_DP_ID = '74300'
  235. CDAS_USER_ID = 'APIADMIN1'
  236. CDAS_OPERATOR_ID = 'ADMIN'
  237. CDAS_PASSWORD = 'CDsl12##'
  238. CDAS_AES_KEY = 'ef0v8js22mhszfirrmis4dnznaoxayke'
  239. CDAS_ENC_PASS = 'CkSG3nGaEzk4DhIeshMl9w=='
  240. CDAS_AUTH_SIGN = 'tUQ5WWqiyNroZqGJpKYCZR9DxSM0bwQpuD17V6cm+DyTCFmptgcWs0KRq6Q0guS/xvjJHcmcLI1gZNKYU8dZpy9Pye+lfJw07qJLF/0hvWs='
  241. CDAS_AUTH_TYPE = 'Basic Og=='
  242. CDAS_CONTENT_TYPE = 'application/json'
  243.  
  244.  
  245. STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, 'AtsERP/', 'static'))
  246. STATIC_URL = '/static/'
  247. MEDIA_URL='/media/'
  248. MEDIA_ROOT = os.path.abspath(os.path.join(BASE_DIR, 'AtsERP/', 'media'))
  249. # MEDIA_ROOT = os.path.join(BASE_DIR,'media')
  250.  
  251. ZERP_UI_OPTION = 'ZERP_UI_DEFAULT'
  252. DATE_INPUT_FORMATS = ['%d-%m-%Y', '%Y-%m-%d', '%d %b %Y HH:MM:SS']
  253.  
  254. BROKER_URL = 'redis://localhost:6379'
  255. CELERY_RESULT_BACKEND = 'redis://localhost:6379'
  256. CELERY_ACCEPT_CONTENT = ['application/json']
  257. CELERY_TASK_SERIALIZER = 'json'
  258. CELERY_RESULT_SERIALIZER = 'json'
  259. CELERY_TIMEZONE = 'Asia/Dhaka'
  260.  
  261. # DEFAULT_FILE_STORAGE = 'db_file_storage.storage.DatabaseFileStorage'
  262.  
  263. """CKYC CREDS"""
  264.  
  265. CKYC_INSTITUTION_CODE = 'IN1954'
  266. CKYC_REGION_CODE = 'BLR'
  267. CKYC_BRANCH_CODE = 'KA01'
  268. CKYC_USER_ID = 'IA004226'
  269. CKYC_USER_ID_1 = 'IA003968'
  270.  
  271. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  272. # EMAIL_HOST = 'smtp.gmail.com'
  273. # EMAIL_USE_TLS = True
  274. # EMAIL_PORT = 587
  275. # EMAIL_HOST_USER = 'info@adityatrading.com'
  276. # EMAIL_HOST_PASSWORD = 'Ats#2021'
  277.  
  278. #changed 04/07/2023
  279.  
  280. EMAIL_HOST = "smtpcorp.netcore.co.in"
  281. EMAIL_USE_TLS = True
  282. EMAIL_USE_SSL = False
  283. EMAIL_PORT = 587
  284. EMAIL_HOST_USER = 'info@adityatrading.com'
  285. EMAIL_HOST_PASSWORD = '@At$3579#'
  286.  
  287. IPO_URL = 'https://ipo.adityatrading.in/addClientDetails/'
  288. XTS_URL = 'https://trading.adityatrading.in/backofficeapi/createinvestorclient/'
  289. API_CONTENT_TYPE = 'application/json'
  290.  
  291. LIVE_URL = MEDIA_ROOT
  292.  
  293. DATA_UPLOAD_MAX_NUMBER_FIELDS = None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement