· 5 years ago · Dec 06, 2019, 04:16 PM
1"""
2Django settings for deals4U project.
3
4Generated by 'django-admin startproject' using Django 2.2.7.
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
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# Quick-start development settings - unsuitable for production
19# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
20
21# SECURITY WARNING: keep the secret key used in production secret!
22SECRET_KEY = 'j5j)u*f2)1=8we4$y@%m%$nr!$qw03j=mweh^vgq4+ox&^nzi6'
23
24# SECURITY WARNING: don't run with debug turned on in production!
25DEBUG = True
26
27ALLOWED_HOSTS = ['*']
28
29# Application definition
30
31INSTALLED_APPS = [
32
33 # Own apps
34 'users',
35 'pages',
36 'offers',
37
38 # 3rd party apps
39 'crispy_forms',
40
41 # Django apps
42 'django.contrib.admin',
43 'django.contrib.auth',
44 'django.contrib.contenttypes',
45 'django.contrib.sessions',
46 'django.contrib.messages',
47 'whitenoise.runserver_nostatic',
48 'django.contrib.staticfiles',
49
50]
51
52MIDDLEWARE = [
53 'django.middleware.security.SecurityMiddleware',
54 'django.contrib.sessions.middleware.SessionMiddleware',
55 'whitenoise.middleware.WhiteNoiseMiddleware',
56 'django.middleware.common.CommonMiddleware',
57 'django.middleware.csrf.CsrfViewMiddleware',
58 'django.contrib.auth.middleware.AuthenticationMiddleware',
59 'django.contrib.messages.middleware.MessageMiddleware',
60 'django.middleware.clickjacking.XFrameOptionsMiddleware',
61]
62
63ROOT_URLCONF = 'deals4U.urls'
64
65TEMPLATES = [
66 {
67 'BACKEND': 'django.template.backends.django.DjangoTemplates',
68 'DIRS': [os.path.join(BASE_DIR, 'templates')],
69 'APP_DIRS': True,
70 'OPTIONS': {
71 'context_processors': [
72 'django.template.context_processors.debug',
73 'django.template.context_processors.request',
74 'django.contrib.auth.context_processors.auth',
75 'django.contrib.messages.context_processors.messages',
76 ],
77 },
78 },
79]
80
81WSGI_APPLICATION = 'deals4U.wsgi.application'
82
83# Database
84# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
85
86DATABASES = {
87 'default': {
88 'ENGINE': 'django.db.backends.sqlite3',
89 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
90 }
91}
92
93# Password validation
94# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
95
96AUTH_PASSWORD_VALIDATORS = [
97 {
98 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
99 },
100 {
101 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
102 },
103 {
104 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
105 },
106 {
107 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
108 },
109]
110
111# Internationalization
112# https://docs.djangoproject.com/en/2.2/topics/i18n/
113
114LANGUAGE_CODE = 'en-us'
115
116TIME_ZONE = 'Europe/Athens'
117
118USE_I18N = True
119
120USE_L10N = True
121
122USE_TZ = True
123
124# Static files (CSS, JavaScript, Images)
125# https://docs.djangoproject.com/en/2.2/howto/static-files/
126
127STATIC_URL = '/static/'
128STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
129STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
130STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
131
132LOGIN_REDIRECT_URL = 'home'
133LOGOUT_REDIRECT_URL = 'home'
134
135AUTH_USER_MODEL = 'users.CustomUser'
136
137CRISPY_TEMPLATE_PACK = 'bootstrap4'
138
139EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
140EMAIL_HOST = 'smtp.gmail.com'
141EMAIL_HOST_USER = 'prosfores4uadm@gmail.com'
142EMAIL_HOST_PASSWORD = 'pqapltrnaldylshj'
143EMAIL_PORT = 587
144EMAIL_USE_TLS = True