Geen omschrijving

settings.py 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. """
  2. Django settings for restful project.
  3. Generated by 'django-admin startproject' using Django 3.1.2.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/3.1/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/3.1/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/3.1/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = 'j(q!!tj1a0yae#js(^7h-@y(g%=no817zm_t5*mf@p0t53l3qf'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = []
  20. LOGGING = {
  21. 'version': 1,
  22. 'disable_existing_loggers': False,
  23. 'handlers': {
  24. 'console': {
  25. 'class': 'logging.StreamHandler',
  26. },
  27. },
  28. 'loggers': {
  29. 'django': {
  30. 'handlers': ['console'],
  31. 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
  32. },
  33. },
  34. }
  35. # Application definition
  36. INSTALLED_APPS = [
  37. 'django.contrib.admin',
  38. 'django.contrib.auth',
  39. 'django.contrib.contenttypes',
  40. 'django.contrib.sessions',
  41. 'django.contrib.messages',
  42. 'django.contrib.staticfiles',
  43. 'CompanionApp',
  44. 'rest_framework'
  45. ]
  46. MIDDLEWARE = [
  47. 'django.middleware.security.SecurityMiddleware',
  48. 'django.contrib.sessions.middleware.SessionMiddleware',
  49. 'django.middleware.common.CommonMiddleware',
  50. 'django.middleware.csrf.CsrfViewMiddleware',
  51. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  52. 'django.contrib.messages.middleware.MessageMiddleware',
  53. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  54. 'django.middleware.common.CommonMiddleware',
  55. ]
  56. ROOT_URLCONF = 'restful.urls'
  57. TEMPLATES = [
  58. {
  59. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  60. 'DIRS': [],
  61. 'APP_DIRS': True,
  62. 'OPTIONS': {
  63. 'context_processors': [
  64. 'django.template.context_processors.debug',
  65. 'django.template.context_processors.request',
  66. 'django.contrib.auth.context_processors.auth',
  67. 'django.contrib.messages.context_processors.messages',
  68. ],
  69. },
  70. },
  71. ]
  72. WSGI_APPLICATION = 'restful.wsgi.application'
  73. # Database
  74. # https://docs.djangoproject.com/en/3.1/ref/settings/#databases
  75. DATABASES = {
  76. 'default': {
  77. 'ENGINE': 'django.db.backends.postgresql',
  78. 'NAME': 'iupi',
  79. 'USER': 'postgres',
  80. 'PASSWORD': 'Danielsofia12',
  81. 'HOST': 'localhost'
  82. }
  83. }
  84. # Password validation
  85. # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
  86. AUTH_PASSWORD_VALIDATORS = [
  87. {
  88. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  89. },
  90. {
  91. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  92. },
  93. {
  94. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  95. },
  96. {
  97. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  98. },
  99. ]
  100. # Internationalization
  101. # https://docs.djangoproject.com/en/3.1/topics/i18n/
  102. LANGUAGE_CODE = 'en-us'
  103. TIME_ZONE = 'UTC'
  104. USE_I18N = True
  105. USE_L10N = True
  106. USE_TZ = True
  107. # Static files (CSS, JavaScript, Images)
  108. # https://docs.djangoproject.com/en/3.1/howto/static-files/
  109. STATIC_URL = '/static/'