· 6 years ago · Jun 06, 2019, 07:44 PM
1"""
2Django settings for Zavrsni project.
3
4Generated by 'django-admin startproject' using Django 2.2.1.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/2.2/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/2.2/ref/settings/
11"""
12
13import os
14import os.path
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# Quick-start development settings - unsuitable for production
20# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = '(@^-d^b!xatf!^6gv2^p%ztj-_vusrc!@vx!tbk-$tj9w7$hw5'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = []
29
30#Mailing
31EMAIL_USE_TLS = True
32EMAIL_HOST = 'smtp.gmail.com'
33EMAIL_HOST_USER = 'mijocevic.matea@gmail.com'
34EMAIL_HOST_PASSWORD = 'ecutegcpwvimdyua'
35EMAIL_PORT = 587
36
37# Application definition
38
39INSTALLED_APPS = [
40 'posts',
41 'relations',
42 'unis',
43 'users',
44 'common',
45 'crispy_forms',
46 'django_filters',
47 'django.contrib.admin',
48 'django.contrib.auth',
49 'django.contrib.contenttypes',
50 'django.contrib.sessions',
51 'django.contrib.messages',
52 'django.contrib.staticfiles',
53
54]
55
56MIDDLEWARE = [
57 'django.middleware.security.SecurityMiddleware',
58 'django.contrib.sessions.middleware.SessionMiddleware',
59 'django.middleware.common.CommonMiddleware',
60 'django.middleware.csrf.CsrfViewMiddleware',
61 'django.contrib.auth.middleware.AuthenticationMiddleware',
62 'django.contrib.messages.middleware.MessageMiddleware',
63 'django.middleware.clickjacking.XFrameOptionsMiddleware',
64]
65
66ROOT_URLCONF = 'Zavrsni.urls'
67
68TEMPLATES = [
69 {
70 'BACKEND': 'django.template.backends.django.DjangoTemplates',
71 'DIRS': ['templates'],
72 'APP_DIRS': True,
73 'OPTIONS': {
74 'context_processors': [
75 'django.template.context_processors.debug',
76 'django.template.context_processors.request',
77 'django.contrib.auth.context_processors.auth',
78 'django.contrib.messages.context_processors.messages',
79 'django.template.context_processors.media',
80 ],
81 },
82 },
83]
84
85
86WSGI_APPLICATION = 'Zavrsni.wsgi.application'
87
88
89# Database
90# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
91
92DATABASES = {
93 'default': {
94 'ENGINE': 'django.db.backends.sqlite3',
95 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
96 }
97}
98
99
100# Password validation
101# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
102
103AUTH_PASSWORD_VALIDATORS = [
104 {
105 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
106 },
107 {
108 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
109 },
110 {
111 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
112 },
113 {
114 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
115 },
116]
117
118
119# Internationalization
120# https://docs.djangoproject.com/en/2.2/topics/i18n/
121
122LANGUAGE_CODE = 'en-us'
123
124TIME_ZONE = 'UTC'
125
126USE_I18N = True
127
128USE_L10N = True
129
130USE_TZ = True
131
132
133# Static files (CSS, JavaScript, Images)
134# https://docs.djangoproject.com/en/2.2/howto/static-files/
135
136STATICFILES_FINDERS = [
137 'django.contrib.staticfiles.finders.FileSystemFinder',
138 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
139]
140
141STATIC_ROOT = os.path.join(BASE_DIR, '/posts/static/')
142STATIC_URL = '/static/'
143
144LOGIN_REDIRECT_URL = '/'
145LOGOUT_REDIRECT_URL = '/'
146
147MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
148MEDIA_URL = '/media/'
149
150AUTH_USER_MODEL = "users.CustomUser"