settings.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. """
  2. Django settings for gd project.
  3. Generated by 'django-admin startproject' using Django 5.0.7.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/5.0/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/5.0/ref/settings/
  8. """
  9. from pathlib import Path
  10. import os
  11. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  12. BASE_DIR = Path(__file__).resolve().parent.parent
  13. # Quick-start development settings - unsuitable for production
  14. # See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = 'django-insecure-dx$w#y$e0%s89^%l7v%6*i%fom(ns-5+#0ul$&u@%#^%9jq7w+'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = ['marchioitalia.it','www.marchioitalia.it','127.0.0.1','localhost',]
  20. # Application definition
  21. INSTALLED_APPS = [
  22. 'django.contrib.admin',
  23. 'django.contrib.auth',
  24. 'django.contrib.contenttypes',
  25. 'django.contrib.sessions',
  26. 'django.contrib.messages',
  27. 'django.contrib.staticfiles',
  28. 'config',
  29. 'login',
  30. 'documento',
  31. 'utente',
  32. 'azienda',
  33. 'att',
  34. ]
  35. MIDDLEWARE = [
  36. 'django.middleware.security.SecurityMiddleware',
  37. 'django.contrib.sessions.middleware.SessionMiddleware',
  38. 'django.middleware.common.CommonMiddleware',
  39. 'django.middleware.csrf.CsrfViewMiddleware',
  40. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  41. 'django.contrib.messages.middleware.MessageMiddleware',
  42. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  43. ]
  44. ROOT_URLCONF = 'gd.urls'
  45. TEMPLATES = [
  46. {
  47. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  48. 'DIRS': [ os.path.join(BASE_DIR,'static/templates'), ],
  49. 'APP_DIRS': True,
  50. 'OPTIONS': {
  51. 'context_processors': [
  52. 'django.template.context_processors.debug',
  53. 'django.template.context_processors.request',
  54. 'django.contrib.auth.context_processors.auth',
  55. 'django.contrib.messages.context_processors.messages',
  56. ],
  57. },
  58. },
  59. ]
  60. WSGI_APPLICATION = 'gd.wsgi.application'
  61. # Database
  62. # https://docs.djangoproject.com/en/5.0/ref/settings/#databases
  63. DATABASES = {
  64. 'default': {
  65. 'ENGINE': 'django.db.backends.sqlite3',
  66. 'NAME': BASE_DIR / 'db/db.sqlite3',
  67. }
  68. }
  69. # Password validation
  70. # https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
  71. AUTH_PASSWORD_VALIDATORS = [
  72. {
  73. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  74. },
  75. {
  76. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  77. },
  78. {
  79. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  80. },
  81. {
  82. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  83. },
  84. ]
  85. # Internationalization
  86. # https://docs.djangoproject.com/en/5.0/topics/i18n/
  87. LANGUAGE_CODE = 'it-it'
  88. TIME_ZONE = 'Europe/Rome'
  89. USE_I18N = True
  90. USE_TZ = True
  91. # Static files (CSS, JavaScript, Images)
  92. # https://docs.djangoproject.com/en/5.0/howto/static-files/
  93. STATIC_URL = 'static/'
  94. # Default primary key field type
  95. # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
  96. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  97. FORCE_SCRIPT_NAME = '/gd'
  98. #la sessione comunque scade alla chiusura del browser
  99. SESSION_EXPIRE_AT_BROWSER_CLOSE=True
  100. #MEDIA_ROOT=os.path.join(BASE_DIR,'static/upload')
  101. #STATICFILES_DIRS = [ os.path.join(BASE_DIR,'static/upload'), ]