· 9 years ago · Jan 07, 2017, 01:26 PM
1"""
2Django settings for PropertySearch project.
3
4Generated by 'django-admin startproject' using Django 1.10.4.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/1.10/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/1.10/ref/settings/
11"""
12
13import os
14
15# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
18
19# Quick-start development settings - unsuitable for production
20# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = 'v$ikr!h=(0ne8ayg-_t67aui#wpxc+xqlr-u^udi%s9(dy3c_('
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = [hidden]
29
30# Application definition
31
32INSTALLED_APPS = [
33 'django.contrib.admin',
34 'django.contrib.auth',
35 'django.contrib.contenttypes',
36 'django.contrib.sessions',
37 'django.contrib.messages',
38 'django.contrib.staticfiles',
39 'search',
40]
41
42MIDDLEWARE = [
43 'django.middleware.security.SecurityMiddleware',
44 'django.contrib.sessions.middleware.SessionMiddleware',
45 'django.middleware.common.CommonMiddleware',
46 'django.middleware.csrf.CsrfViewMiddleware',
47 'django.contrib.auth.middleware.AuthenticationMiddleware',
48 'django.contrib.messages.middleware.MessageMiddleware',
49 'django.middleware.clickjacking.XFrameOptionsMiddleware',
50]
51
52ROOT_URLCONF = 'PropertySearch.urls'
53
54TEMPLATES = [
55 {
56 'BACKEND': 'django.template.backends.django.DjangoTemplates',
57 'DIRS': [os.path.join(BASE_DIR, 'templates')]
58 ,
59 'APP_DIRS': True,
60 'OPTIONS': {
61 'context_processors': [
62 'django.template.context_processors.debug',
63 'django.template.context_processors.request',
64 'django.contrib.auth.context_processors.auth',
65 'django.contrib.messages.context_processors.messages',
66 ],
67 },
68 },
69]
70
71WSGI_APPLICATION = 'PropertySearch.wsgi.application'
72
73
74# Database
75# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
76
77DATABASES = {
78 'default': {
79# 'ENGINE': 'django.db.backends.sqlite3',
80# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
81 'ENGINE': 'django.db.backends.postgresql',
82 'NAME': [hidden]
83 'USER': [hidden]
84 'PASSWORD': [hidden]
85 'HOST': 'db.propertysearch.markcoker.com.au',
86 }
87}
88
89
90# Password validation
91# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
92
93AUTH_PASSWORD_VALIDATORS = [
94 {
95 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
96 },
97 {
98 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
99 },
100 {
101 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
102 },
103 {
104 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
105 },
106]
107
108EMAIL_USE_TLS = True
109EMAIL_HOST = 'smtp.gmail.com'
110EMAIL_PORT = 587
111EMAIL_HOST_USER = [hidden]
112EMAIL_HOST_PASSWORD = [hidden]
113DEFAULT_FROM_EMAIL = [hidden]
114EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
115SERVER_EMAIL = [hidden]
116
117# Internationalization
118# https://docs.djangoproject.com/en/1.10/topics/i18n/
119
120LANGUAGE_CODE = 'en-gb'
121
122TIME_ZONE = 'UTC'
123
124USE_I18N = True
125
126USE_L10N = True
127
128USE_TZ = True
129
130
131STATIC_URL = '/static/'
132STATICFILES_DIRS = [
133 os.path.join(BASE_DIR,'search/static/'),
134]
135STATIC_ROOT='/var/www/html/search/static/'
136LOGIN_REDIRECT_URL = ('/')
137LOGOUT_REDIRECT_URL = ('/')