· 6 years ago · May 23, 2019, 07:42 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, ...)
17PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
18BASE_DIR = os.path.dirname(PROJECT_DIR)
19
20# Quick-start development settings - unsuitable for production
21# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
22
23# SECURITY WARNING: keep the secret key used in production secret!
24SECRET_KEY = '(@^-d^b!xatf!^6gv2^p%ztj-_vusrc!@vx!tbk-$tj9w7$hw5'
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 'common',
36 'posts',
37 'relations',
38 'unis',
39 'users',
40 'django.contrib.admin',
41 'django.contrib.auth',
42 'django.contrib.contenttypes',
43 'django.contrib.sessions',
44 'django.contrib.messages',
45 'django.contrib.staticfiles',
46
47]
48
49MIDDLEWARE = [
50 'django.middleware.security.SecurityMiddleware',
51 'django.contrib.sessions.middleware.SessionMiddleware',
52 'django.middleware.common.CommonMiddleware',
53 'django.middleware.csrf.CsrfViewMiddleware',
54 'django.contrib.auth.middleware.AuthenticationMiddleware',
55 'django.contrib.messages.middleware.MessageMiddleware',
56 'django.middleware.clickjacking.XFrameOptionsMiddleware',
57]
58
59ROOT_URLCONF = 'Zavrsni.urls'
60
61TEMPLATES = [
62 {
63 'BACKEND': 'django.template.backends.django.DjangoTemplates',
64 'DIRS': ['templates'],
65 'APP_DIRS': True,
66 'OPTIONS': {
67 'context_processors': [
68 'django.template.context_processors.debug',
69 'django.template.context_processors.request',
70 'django.contrib.auth.context_processors.auth',
71 'django.contrib.messages.context_processors.messages',
72 ],
73 },
74 },
75]
76
77
78WSGI_APPLICATION = 'Zavrsni.wsgi.application'
79
80
81# Database
82# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
83
84DATABASES = {
85 'default': {
86 'ENGINE': 'django.db.backends.sqlite3',
87 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
88 }
89}
90
91
92# Password validation
93# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
94
95AUTH_PASSWORD_VALIDATORS = [
96 {
97 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
98 },
99 {
100 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
101 },
102 {
103 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
104 },
105 {
106 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
107 },
108]
109
110
111# Internationalization
112# https://docs.djangoproject.com/en/2.2/topics/i18n/
113
114LANGUAGE_CODE = 'en-us'
115
116TIME_ZONE = 'UTC'
117
118USE_I18N = True
119
120USE_L10N = True
121
122USE_TZ = True
123
124
125# Static files (CSS, JavaScript, Images)
126# https://docs.djangoproject.com/en/2.2/howto/static-files/
127
128STATICFILES_FINDERS = [
129 'django.contrib.staticfiles.finders.FileSystemFinder',
130 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
131]
132STATICFILES_DIRS = (os.path.join(BASE_DIR, 'templates/static'),
133 '/var/www/static/', )
134STATIC_ROOT = os.path.join(BASE_DIR, 'Zavrsni/templates/static')
135STATIC_URL = '/static/'
136
137LOGIN_REDIRECT_URL = '/home/'
138LOGOUT_REDIRECT_URL = '/'
139
140MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
141MEDIA_URL = '/media/'
142
143AUTH_USER_MODEL = "users.CustomUser"