2
0

settings.py 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. """
  2. Django settings for dashboard4 project.
  3. For more information on this file, see
  4. https://docs.djangoproject.com/en/2.1/topics/settings/
  5. For the full list of settings and their values, see
  6. https://docs.djangoproject.com/en/2.1/ref/settings/
  7. """
  8. import os
  9. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  10. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  11. # Quick-start development settings - unsuitable for production
  12. # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
  13. # SECURITY WARNING: keep the secret key used in production secret!
  14. SECRET_KEY = 'orb8q7e9aw#4yc5^k7fj8yz93!xy&3vj4b23&4(nzcbg7$=x97'
  15. # SECURITY WARNING: don't run with debug turned on in production!
  16. DEBUG = True
  17. ALLOWED_HOSTS = ['www.altemica.net','altemica.net','www.altemica.com','altemica.com']
  18. CSRF_TRUSTED_ORIGINS = ['https://altemica.net','https://www.altemica.net',]
  19. # Application definition
  20. INSTALLED_APPS = [
  21. 'django.contrib.admin',
  22. 'django.contrib.auth',
  23. 'django.contrib.contenttypes',
  24. 'django.contrib.sessions',
  25. 'django.contrib.messages',
  26. #'django.contrib.staticfiles',
  27. 'configurazione',
  28. 'login',
  29. 'sicurezza',
  30. 'utenti',
  31. 'domini',
  32. 'registrar',
  33. 'cancellazione',
  34. #'servizi',
  35. 'causali',
  36. 'history',
  37. 'contatti',
  38. 'alias',
  39. #'coda',
  40. 'logger',
  41. 'comunicazioni',
  42. 'template',
  43. 'ftp',
  44. 'liste',
  45. 'mail',
  46. 'database',
  47. 'target',
  48. 'note',
  49. 'mqtt',
  50. 'filtro',
  51. 'web',
  52. 'proxy',
  53. 'supporto',
  54. 'spam',
  55. ]
  56. '''
  57. disabled:
  58. '''
  59. SESSION_ENGINE = 'django.contrib.sessions.backends.file'
  60. MIDDLEWARE = [
  61. 'django.middleware.security.SecurityMiddleware',
  62. 'django.contrib.sessions.middleware.SessionMiddleware',
  63. 'django.middleware.common.CommonMiddleware',
  64. 'django.middleware.csrf.CsrfViewMiddleware',
  65. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  66. 'django.contrib.messages.middleware.MessageMiddleware',
  67. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  68. ]
  69. ROOT_URLCONF = 'dashboard4.urls'
  70. TEMPLATES = [
  71. {
  72. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  73. 'DIRS': [ os.path.join(BASE_DIR,'static/basic'), ],
  74. 'APP_DIRS': True,
  75. 'OPTIONS': {
  76. 'context_processors': [
  77. 'django.template.context_processors.debug',
  78. 'django.template.context_processors.request',
  79. 'django.contrib.auth.context_processors.auth',
  80. 'django.contrib.messages.context_processors.messages',
  81. ],
  82. },
  83. },
  84. ]
  85. WSGI_APPLICATION = 'dashboard4.wsgi.application'
  86. # Database
  87. # https://docs.djangoproject.com/en/2.1/ref/settings/#databases
  88. DATABASES = {
  89. 'default': {
  90. 'ENGINE': 'django.db.backends.mysql',
  91. 'NAME':'services',
  92. 'USER':'_services_',
  93. 'PASSWORD':'_Empatia2024_',
  94. 'HOST': '10.55.224.206',
  95. 'PORT': '',
  96. }
  97. }
  98. # Password validation
  99. # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
  100. AUTH_PASSWORD_VALIDATORS = [
  101. {
  102. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  103. },
  104. {
  105. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  106. },
  107. {
  108. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  109. },
  110. {
  111. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  112. },
  113. ]
  114. # Internationalization
  115. # https://docs.djangoproject.com/en/2.1/topics/i18n/
  116. LANGUAGE_CODE = 'it-it'
  117. TIME_ZONE = 'Europe/Rome'
  118. USE_I18N = True
  119. USE_L10N = True
  120. USE_TZ = True
  121. # Static files (CSS, JavaScript, Images)
  122. # https://docs.djangoproject.com/en/2.1/howto/static-files/
  123. STATIC_URL='dashboard4_static/'
  124. #STATIC_ROOT = '/d'
  125. #/home/net005/966.it/ftp/dashboard4/static'
  126. STATICFILES_DIRS = [ os.path.join(BASE_DIR,'images'), ]
  127. # da attivare quando in servizio
  128. FORCE_SCRIPT_NAME = '/dashboard4'
  129. #la sessione comunque scade alla chiusura del browser
  130. SESSION_EXPIRE_AT_BROWSER_CLOSE=True