· 7 years ago · May 31, 2018, 07:24 AM
1"""
2Django settings for Studis project.
3
4Generated by 'django-admin startproject' using Django 2.0.3.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/2.0/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/2.0/ref/settings/
11"""
12from datetime import timedelta
13import os
14import dj_database_url
15
16# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
17BASE_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!
24SECRET_KEY = '@m$oyz3p*x158fn4yv!9an*y819hyysxxbyfkvb*r1$8cxbe-*'
25
26# SECURITY WARNING: don't run with debug turned on in production!
27DEBUG = True
28
29ALLOWED_HOSTS = []
30
31
32# Application definition
33
34INSTALLED_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
54MIDDLEWARE = [
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
65INTERNAL_IPS = ['127.0.0.1']
66
67ROOT_URLCONF = 'Studis.urls'
68
69TEMPLATES = [
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
92WSGI_APPLICATION = 'Studis.wsgi.application'
93AUTH_USER_MODEL = "Studis.User"
94LOGIN_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
106DATABASES = {
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
117AUTH_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
136LANGUAGE_CODE = 'en-us'
137
138TIME_ZONE = 'UTC'
139
140USE_I18N = True
141
142USE_L10N = False
143
144USE_TZ = True
145
146DATE_INPUT_FORMATS = ['%d.%m.%Y']
147TIME_INPUT_FORMATS = ('%H:%M',)
148
149
150
151# Static files (CSS, JavaScript, Images)
152# https://docs.djangoproject.com/en/2.0/howto/static-files/
153STATIC_URL = '/static/'
154
155STATICFILES_DIRS = (
156 os.path.join(BASE_DIR, 'static'),
157)
158
159STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
160MEDIA_URL="/media/"
161MEDIA_ROOT = os.path.join(BASE_DIR,'media')
162
163
164# Email via SendGrid settings
165
166EMAIL_HOST = 'smtp.sendgrid.net'
167EMAIL_HOST_USER = 'tabal5000'
168EMAIL_HOST_PASSWORD = 'tojetpogeslo1'
169EMAIL_PORT = 587
170EMAIL_USE_TLS = True