· 6 years ago · May 05, 2019, 09:22 PM
1"""
2Django settings for atendendo 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
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/2.2/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = 'a-st(vatu-ugkof$2p$*c4ob*mu^81h@uc83)*mad8fa^mxyv&'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = []
29
30
31# Application definition
32
33INSTALLED_APPS = [
34 'django.contrib.admin',
35 'django.contrib.auth',
36 'django.contrib.contenttypes',
37 'django.contrib.sessions',
38 'django.contrib.messages',
39 'django.contrib.staticfiles',
40 'django.contrib.sites',
41 'django.contrib.humanize',
42 'markdown_deux',
43 'bootstrapform',
44 'helpdesk'
45]
46
47MIDDLEWARE = [
48 'django.middleware.security.SecurityMiddleware',
49 'django.contrib.sessions.middleware.SessionMiddleware',
50 'django.middleware.common.CommonMiddleware',
51 'django.middleware.csrf.CsrfViewMiddleware',
52 'django.contrib.auth.middleware.AuthenticationMiddleware',
53 'django.contrib.messages.middleware.MessageMiddleware',
54 'django.middleware.clickjacking.XFrameOptionsMiddleware',
55]
56
57ROOT_URLCONF = 'atendendo.urls'
58
59TEMPLATES = [
60 {
61 'BACKEND': 'django.template.backends.django.DjangoTemplates',
62 'DIRS': [
63 ],
64 'APP_DIRS': True,
65 'OPTIONS': {
66 'context_processors': [
67 'django.template.context_processors.debug',
68 'django.template.context_processors.request',
69 'django.contrib.auth.context_processors.auth',
70 'django.contrib.messages.context_processors.messages',
71 ],
72 },
73 },
74]
75
76WSGI_APPLICATION = 'atendendo.wsgi.application'
77
78
79# django-helpdesk configuration settings
80# You can override django-helpdesk's defaults by redefining them here.
81# To see what settings are available, see the docs/configuration.rst
82# file for more information.
83# Some common settings are below.
84
85HELPDESK_DEFAULT_SETTINGS = {
86 'use_email_as_submitter': True,
87 'email_on_ticket_assign': True,
88 'email_on_ticket_change': True,
89 'login_view_ticketlist': True,
90 'email_on_ticket_apichange': True,
91 'preset_replies': True,
92 'tickets_per_page': 25
93}
94
95# Should the public web portal be enabled?
96HELPDESK_PUBLIC_ENABLED = True
97HELPDESK_VIEW_A_TICKET_PUBLIC = True
98HELPDESK_SUBMIT_A_TICKET_PUBLIC = True
99
100# Should the Knowledgebase be enabled?
101HELPDESK_KB_ENABLED = True
102
103# Allow users to change their passwords
104HELPDESK_SHOW_CHANGE_PASSWORD = False
105
106# Instead of showing the public web portal first,
107# we can instead redirect users straight to the login page.
108HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT = False
109LOGIN_URL = '/login/'
110LOGIN_REDIRECT_URL = '/login/'
111
112
113# Database
114# - by default, we use SQLite3 for the demo, but you can also
115# configure MySQL or PostgreSQL, see the docs for more:
116# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
117
118DATABASES = {
119 'default': {
120 'ENGINE': 'django.db.backends.postgresql',
121 'NAME': 'demodesk',
122 'USER': 'postgres',
123 'PASSWORD': '123456',
124 'HOST': '127.0.0.1',
125 'PORT': '5432',
126 }
127}
128
129
130# Sites
131# - this allows hosting of more than one site from a single server,
132# in practice you can probably just leave this default if you only
133# host a single site, but read more in the docs:
134# https://docs.djangoproject.com/en/1.11/ref/contrib/sites/
135
136SITE_ID = 1
137
138
139# Sessions
140# https://docs.djangoproject.com/en/1.11/topics/http/sessions
141
142SESSION_COOKIE_AGE = 86400 # = 1 day
143
144# For better default security, set these cookie flags, but
145# these are likely to cause problems when testing locally
146#CSRF_COOKIE_SECURE = True
147#SESSION_COOKIE_SECURE = True
148#CSRF_COOKIE_HTTPONLY = True
149#SESSION_COOKIE_HTTPONLY = True
150
151
152# Password validation
153# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
154
155AUTH_PASSWORD_VALIDATORS = [
156 {
157 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
158 },
159 {
160 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
161 },
162 {
163 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
164 },
165 {
166 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
167 },
168]
169
170# Email
171# https://docs.djangoproject.com/en/1.11/topics/email/
172
173# This demo uses the console backend, which simply prints emails to the console
174# rather than actually sending them out.
175DEFAULT_FROM_EMAIL = 'helpdesk@example.com'
176SERVER_EMAIL = 'helpdesk@example.com'
177EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
178
179# If you want to test sending real emails, uncomment and modify the following:
180#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
181#EMAIL_HOST = 'smtp.example.com'
182#EMAIL_PORT = '25'
183
184
185# Internationalization
186# https://docs.djangoproject.com/en/2.2/topics/i18n/
187
188#LANGUAGE_CODE = 'en-us'
189LANGUAGE_CODE = 'pt-BR'
190
191TIME_ZONE = 'UTC'
192
193USE_I18N = True
194
195USE_L10N = True
196
197USE_TZ = True
198
199
200# Static files (CSS, JavaScript, Images)
201# https://docs.djangoproject.com/en/1.11/howto/static-files/
202
203STATIC_URL = '/static/'
204# static root needs to be defined in order to use collectstatic
205STATIC_ROOT = os.path.join(BASE_DIR, 'static')
206
207# MEDIA_ROOT is where media uploads are stored.
208# We set this to a directory to host file attachments created
209# with tickets.
210MEDIA_URL = '/media/'
211MEDIA_ROOT = os.path.join(BASE_DIR, 'media')