2017-03-20 07:38:44 +01:00
|
|
|
"""
|
|
|
|
Django settings for django-helpdesk demodesk project.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
2022-07-22 03:26:41 +02:00
|
|
|
|
2017-03-20 07:38:44 +01:00
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
2017-12-18 06:28:03 +01:00
|
|
|
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
|
|
SECRET_KEY = '_crkn1+fnzu5$vns_-d+^ayiq%z4k*s!!ag0!mfy36(y!vrazd'
|
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
|
DEBUG = True
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
|
2021-09-28 05:19:06 +02:00
|
|
|
# SECURITY WARNING: you probably want to configure your server
|
|
|
|
# to use HTTPS with secure cookies, then you'd want to set
|
|
|
|
# the following settings:
|
|
|
|
#
|
|
|
|
#SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
|
|
|
#SESSION_COOKIE_SECURE = True
|
|
|
|
#CSRF_COOKIE_SECURE = True
|
|
|
|
#
|
|
|
|
# We leave them commented out here because most likely for
|
|
|
|
# an internal demo you don't need such security, but please
|
|
|
|
# remember when setting up your own development / production server!
|
|
|
|
|
2023-11-15 01:41:56 +01:00
|
|
|
# Default teams mode to enabled unless overridden by an environment variable set to "false"
|
2023-11-16 10:02:12 +01:00
|
|
|
HELPDESK_TEAMS_MODE_ENABLED=os.getenv("HELPDESK_TEAMS_MODE_ENABLED", "true").lower() == "true"
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
# Application definition
|
|
|
|
INSTALLED_APPS = [
|
|
|
|
'django.contrib.admin',
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
|
|
|
'django.contrib.staticfiles',
|
|
|
|
'django.contrib.sites',
|
|
|
|
'django.contrib.humanize',
|
2018-09-03 05:27:39 +02:00
|
|
|
'bootstrap4form',
|
2021-08-20 08:05:21 +02:00
|
|
|
'helpdesk', # This is us!
|
2022-03-31 17:19:49 +02:00
|
|
|
'rest_framework', # required for the API
|
2017-03-20 07:38:44 +01:00
|
|
|
]
|
2023-11-15 01:41:56 +01:00
|
|
|
if HELPDESK_TEAMS_MODE_ENABLED:
|
|
|
|
INSTALLED_APPS.extend([
|
|
|
|
'account', # Required by pinax-teams
|
|
|
|
'pinax.invitations', # required by pinax-teams
|
|
|
|
'pinax.teams', # team support
|
|
|
|
'reversion', # required by pinax-teams
|
|
|
|
])
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
MIDDLEWARE = [
|
|
|
|
'django.middleware.security.SecurityMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
|
]
|
|
|
|
|
2024-03-11 14:46:27 +01:00
|
|
|
ROOT_URLCONF = 'demodesk.config.urls'
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
'OPTIONS': {
|
2017-10-30 05:56:06 +01:00
|
|
|
'debug': True,
|
2017-03-20 07:38:44 +01:00
|
|
|
'context_processors': [
|
|
|
|
'django.template.context_processors.debug',
|
|
|
|
'django.template.context_processors.request',
|
|
|
|
'django.contrib.auth.context_processors.auth',
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2024-03-11 14:46:27 +01:00
|
|
|
WSGI_APPLICATION = 'demodesk.config.wsgi.application'
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
# django-helpdesk configuration settings
|
|
|
|
# You can override django-helpdesk's defaults by redefining them here.
|
|
|
|
# To see what settings are available, see the docs/configuration.rst
|
|
|
|
# file for more information.
|
|
|
|
# Some common settings are below.
|
|
|
|
|
|
|
|
HELPDESK_DEFAULT_SETTINGS = {
|
2022-07-12 12:34:19 +02:00
|
|
|
'use_email_as_submitter': True,
|
|
|
|
'email_on_ticket_assign': True,
|
|
|
|
'email_on_ticket_change': True,
|
|
|
|
'login_view_ticketlist': True,
|
|
|
|
'email_on_ticket_apichange': True,
|
|
|
|
'preset_replies': True,
|
|
|
|
'tickets_per_page': 25
|
2017-03-20 07:38:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Should the public web portal be enabled?
|
|
|
|
HELPDESK_PUBLIC_ENABLED = True
|
|
|
|
HELPDESK_VIEW_A_TICKET_PUBLIC = True
|
|
|
|
HELPDESK_SUBMIT_A_TICKET_PUBLIC = True
|
|
|
|
|
|
|
|
# Should the Knowledgebase be enabled?
|
|
|
|
HELPDESK_KB_ENABLED = True
|
|
|
|
|
2022-04-15 18:48:21 +02:00
|
|
|
HELPDESK_TICKETS_TIMELINE_ENABLED = True
|
|
|
|
|
2019-03-10 00:38:24 +01:00
|
|
|
# Allow users to change their passwords
|
|
|
|
HELPDESK_SHOW_CHANGE_PASSWORD = True
|
|
|
|
|
2017-03-20 07:38:44 +01:00
|
|
|
# Instead of showing the public web portal first,
|
|
|
|
# we can instead redirect users straight to the login page.
|
|
|
|
HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT = False
|
2021-01-04 20:02:25 +01:00
|
|
|
LOGIN_URL = 'helpdesk:login'
|
|
|
|
LOGIN_REDIRECT_URL = 'helpdesk:home'
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
# Database
|
|
|
|
# - by default, we use SQLite3 for the demo, but you can also
|
|
|
|
# configure MySQL or PostgreSQL, see the docs for more:
|
2017-12-18 06:28:03 +01:00
|
|
|
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Sites
|
|
|
|
# - this allows hosting of more than one site from a single server,
|
|
|
|
# in practice you can probably just leave this default if you only
|
|
|
|
# host a single site, but read more in the docs:
|
2017-12-18 06:28:03 +01:00
|
|
|
# https://docs.djangoproject.com/en/1.11/ref/contrib/sites/
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
SITE_ID = 1
|
|
|
|
|
|
|
|
|
|
|
|
# Sessions
|
2017-12-18 06:28:03 +01:00
|
|
|
# https://docs.djangoproject.com/en/1.11/topics/http/sessions
|
2017-03-20 07:38:44 +01:00
|
|
|
|
2022-07-12 12:34:19 +02:00
|
|
|
SESSION_COOKIE_AGE = 86400 # = 1 day
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
# For better default security, set these cookie flags, but
|
|
|
|
# these are likely to cause problems when testing locally
|
|
|
|
#CSRF_COOKIE_SECURE = True
|
|
|
|
#SESSION_COOKIE_SECURE = True
|
|
|
|
#CSRF_COOKIE_HTTPONLY = True
|
|
|
|
#SESSION_COOKIE_HTTPONLY = True
|
|
|
|
|
|
|
|
|
|
|
|
# Password validation
|
2017-12-18 06:28:03 +01:00
|
|
|
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
# Email
|
2017-12-18 06:28:03 +01:00
|
|
|
# https://docs.djangoproject.com/en/1.11/topics/email/
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
# This demo uses the console backend, which simply prints emails to the console
|
|
|
|
# rather than actually sending them out.
|
|
|
|
DEFAULT_FROM_EMAIL = 'helpdesk@example.com'
|
|
|
|
SERVER_EMAIL = 'helpdesk@example.com'
|
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
|
|
|
|
|
|
|
# If you want to test sending real emails, uncomment and modify the following:
|
|
|
|
#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
|
|
|
#EMAIL_HOST = 'smtp.example.com'
|
|
|
|
#EMAIL_PORT = '25'
|
|
|
|
|
|
|
|
# Internationalization
|
2017-12-18 06:28:03 +01:00
|
|
|
# https://docs.djangoproject.com/en/1.11/topics/i18n/
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
# By default, django-helpdesk uses en, but other languages are also available.
|
2017-12-18 06:28:03 +01:00
|
|
|
# The most complete translations are: es-MX, ru, zh-Hans
|
2017-03-20 07:38:44 +01:00
|
|
|
# Contribute to our translations via Transifex if you can!
|
|
|
|
# See CONTRIBUTING.rst for more info.
|
|
|
|
LANGUAGE_CODE = 'en-US'
|
|
|
|
|
|
|
|
TIME_ZONE = 'UTC'
|
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
2017-12-18 06:28:03 +01:00
|
|
|
# https://docs.djangoproject.com/en/1.11/howto/static-files/
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
STATIC_URL = '/static/'
|
2017-12-28 12:32:42 +01:00
|
|
|
# static root needs to be defined in order to use collectstatic
|
|
|
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
2017-03-20 07:38:44 +01:00
|
|
|
|
|
|
|
# MEDIA_ROOT is where media uploads are stored.
|
|
|
|
# We set this to a directory to host file attachments created
|
|
|
|
# with tickets.
|
|
|
|
MEDIA_URL = '/media/'
|
|
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
|
|
|
|
|
|
|
# Fixtures
|
2017-12-18 06:28:03 +01:00
|
|
|
# https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-FIXTURE_DIRS
|
2017-03-20 07:38:44 +01:00
|
|
|
# - This is only necessary to make the demo project work, not needed for
|
|
|
|
# your own projects unless you make your own fixtures
|
|
|
|
FIXTURE_DIRS = [os.path.join(BASE_DIR, 'fixtures')]
|
2017-09-27 19:40:47 +02:00
|
|
|
|
2021-09-17 16:09:20 +02:00
|
|
|
|
|
|
|
# for Django 3.2+, set default for autofields:
|
|
|
|
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
|
|
|
|
2017-09-27 19:40:47 +02:00
|
|
|
try:
|
|
|
|
from .local_settings import *
|
|
|
|
except ImportError:
|
|
|
|
pass
|