Digital Rights Management für elektronische Patientenakten
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

settings.py 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. """
  2. Django settings for Contentserver project.
  3. Generated by 'django-admin startproject' using Django 3.1.4.
  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 = '#^9h3-tg+(r__c)5m9@51#iq+f!e+ifr2&(q3y_3w=-9h2aizr'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = ['192.168.192.75', '188.195.130.70', '0.0.0.0', 'localhost', '127.0.0.1']
  20. CORS_ORIGIN_ALLOW_ALL=True
  21. # Application definition
  22. INSTALLED_APPS = [
  23. 'corsheaders',
  24. 'django.contrib.admin',
  25. 'django.contrib.auth',
  26. 'django.contrib.contenttypes',
  27. 'django.contrib.sessions',
  28. 'django.contrib.messages',
  29. 'django.contrib.staticfiles',
  30. 'rest_framework',
  31. 'health_view'
  32. ]
  33. REST_FRAMEWORK = {
  34. # Use Django's standard `django.contrib.auth` permissions,
  35. # or allow read-only access for unauthenticated users.
  36. 'DEFAULT_PERMISSION_CLASSES': [
  37. 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
  38. ],
  39. 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
  40. 'PAGE_SIZE': 10
  41. }
  42. MIDDLEWARE = [
  43. 'corsheaders.middleware.CorsMiddleware',
  44. 'django.middleware.common.CommonMiddleware',
  45. 'django.middleware.security.SecurityMiddleware',
  46. 'django.contrib.sessions.middleware.SessionMiddleware',
  47. 'django.middleware.common.CommonMiddleware',
  48. 'django.middleware.csrf.CsrfViewMiddleware',
  49. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  50. 'django.contrib.messages.middleware.MessageMiddleware',
  51. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  52. ]
  53. ROOT_URLCONF = 'Contentserver.urls'
  54. TEMPLATES = [
  55. {
  56. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  57. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  58. 'APP_DIRS': True,
  59. 'OPTIONS': {
  60. 'context_processors': [
  61. 'django.template.context_processors.debug',
  62. 'django.template.context_processors.request',
  63. 'django.contrib.auth.context_processors.auth',
  64. 'django.contrib.messages.context_processors.messages',
  65. ],
  66. },
  67. },
  68. ]
  69. WSGI_APPLICATION = 'Contentserver.wsgi.application'
  70. # Database
  71. # https://docs.djangoproject.com/en/3.1/ref/settings/#databases
  72. DATABASES = {
  73. 'default': {
  74. 'ENGINE': 'django.db.backends.sqlite3',
  75. 'NAME': BASE_DIR / 'db.sqlite3',
  76. }
  77. }
  78. # Password validation
  79. # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
  80. AUTH_PASSWORD_VALIDATORS = [
  81. {
  82. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  83. },
  84. {
  85. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  86. },
  87. {
  88. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  89. },
  90. {
  91. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  92. },
  93. ]
  94. # Internationalization
  95. # https://docs.djangoproject.com/en/3.1/topics/i18n/
  96. LANGUAGE_CODE = 'en-us'
  97. TIME_ZONE = 'Europe/Berlin'
  98. USE_I18N = True
  99. USE_L10N = True
  100. USE_TZ = True
  101. # Static files (CSS, JavaScript, Images)
  102. # https://docs.djangoproject.com/en/3.1/howto/static-files/
  103. STATIC_URL = '/static/'
  104. LOGIN_REDIRECT_URL = '/'