Advertisement
Guest User

Untitled

a guest
May 31st, 2018
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.32 KB | None | 0 0
  1. """
  2. Django settings for Studis project.
  3.  
  4. Generated by 'django-admin startproject' using Django 2.0.3.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/2.0/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/2.0/ref/settings/
  11. """
  12. from datetime import timedelta
  13. import os
  14. import dj_database_url
  15.  
  16. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  17. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  18.  
  19.  
  20. # Quick-start development settings - unsuitable for production
  21. # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
  22.  
  23. # SECURITY WARNING: keep the secret key used in production secret!
  24. SECRET_KEY = '@m$oyz3p*x158fn4yv!9an*y819hyysxxbyfkvb*r1$8cxbe-*'
  25.  
  26. # SECURITY WARNING: don't run with debug turned on in production!
  27. DEBUG = True
  28.  
  29. ALLOWED_HOSTS = []
  30.  
  31.  
  32. # Application definition
  33.  
  34. INSTALLED_APPS = [
  35. 'django.contrib.admin',
  36. 'django.contrib.auth',
  37. 'django.contrib.contenttypes',
  38. 'django.contrib.sessions',
  39. 'django.contrib.messages',
  40. 'django.contrib.staticfiles',
  41. 'api',
  42. 'Studis',
  43. 'osebje',
  44. 'student',
  45. 'vpis',
  46. 'rest_framework',
  47. 'authorization',
  48. 'widget_tweaks',
  49. 'debug_toolbar',
  50. 'mathfilters',
  51. #'django_polymorphic',
  52. ]
  53.  
  54. MIDDLEWARE = [
  55. 'debug_toolbar.middleware.DebugToolbarMiddleware',
  56. 'django.middleware.security.SecurityMiddleware',
  57. 'django.contrib.sessions.middleware.SessionMiddleware',
  58. 'django.middleware.common.CommonMiddleware',
  59. 'django.middleware.csrf.CsrfViewMiddleware',
  60. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  61. 'django.contrib.messages.middleware.MessageMiddleware',
  62. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  63. ]
  64.  
  65. INTERNAL_IPS = ['127.0.0.1']
  66.  
  67. ROOT_URLCONF = 'Studis.urls'
  68.  
  69. TEMPLATES = [
  70. {
  71. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  72. 'DIRS': [os.path.join(BASE_DIR, 'templates')]
  73. ,
  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. 'libraries':{
  84. 'studis_extras': 'Studis.templatetags.studis_extras',
  85.  
  86. }
  87. },
  88. },
  89. ]
  90.  
  91.  
  92. WSGI_APPLICATION = 'Studis.wsgi.application'
  93. AUTH_USER_MODEL = "Studis.User"
  94. LOGIN_REDIRECT_URL = 'student_list'
  95.  
  96.  
  97.  
  98. # Database
  99. # https://docs.djangoproject.com/en/2.0/ref/settings/#databases
  100.  
  101. """DATABASES = {
  102. 'default': dj_database_url.parse('postgres://hbrfhhzupwiohr:074d5a52c6a3c7d0457e8d148ec78f6a013b9de19e5a23e7d24ead2b709a303e@ec2-54-75-244-248.eu-west-1.compute.amazonaws.com:5432/dfaas1k9kr55ae')
  103. }
  104. """
  105.  
  106. DATABASES = {
  107. 'default': {
  108. 'ENGINE': 'django.db.backends.sqlite3',
  109. 'NAME': 'sqlite3.sql',
  110. }
  111. }
  112.  
  113.  
  114. # Password validation
  115. # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
  116.  
  117. AUTH_PASSWORD_VALIDATORS = [
  118. {
  119. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  120. },
  121. {
  122. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  123. },
  124. {
  125. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  126. },
  127. {
  128. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  129. },
  130. ]
  131.  
  132.  
  133. # Internationalization
  134. # https://docs.djangoproject.com/en/2.0/topics/i18n/
  135.  
  136. LANGUAGE_CODE = 'en-us'
  137.  
  138. TIME_ZONE = 'UTC'
  139.  
  140. USE_I18N = True
  141.  
  142. USE_L10N = False
  143.  
  144. USE_TZ = True
  145.  
  146. DATE_INPUT_FORMATS = ['%d.%m.%Y']
  147. TIME_INPUT_FORMATS = ('%H:%M',)
  148.  
  149.  
  150.  
  151. # Static files (CSS, JavaScript, Images)
  152. # https://docs.djangoproject.com/en/2.0/howto/static-files/
  153. STATIC_URL = '/static/'
  154.  
  155. STATICFILES_DIRS = (
  156. os.path.join(BASE_DIR, 'static'),
  157. )
  158.  
  159. STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  160. MEDIA_URL="/media/"
  161. MEDIA_ROOT = os.path.join(BASE_DIR,'media')
  162.  
  163.  
  164. # Email via SendGrid settings
  165.  
  166. EMAIL_HOST = 'smtp.sendgrid.net'
  167. EMAIL_HOST_USER = 'tabal5000'
  168. EMAIL_HOST_PASSWORD = 'tojetpogeslo1'
  169. EMAIL_PORT = 587
  170. EMAIL_USE_TLS = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement