OrdersApp/SpitiGlykou/settings.py

203 lines
5.5 KiB
Python

"""
Django settings for SpitiGlykou project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
import dj_database_url
import django
from django.utils.encoding import force_str
django.utils.encoding.force_text = force_str
BASE_DIR = Path(__file__).resolve().parent.parent
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'SpitiGlykou.settings')
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '+&v==p6stqqi4+tuo)nkj+-s=5^ajd@x+3-p2s%@y!2&uwrth8'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
#DEBUG = False
ALLOWED_HOSTS = ["spitiglykou.gr", "spitiglykou.gr", "dash.argideli.com"]
# Application definition
INSTALLED_APPS = [
#'orders_app.apps.OrdersAppConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'phonenumber_field',
'django.contrib.staticfiles',
'crispy_forms',
'crispy_bootstrap4',
'django_addanother',
'orders_app',
]
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap4"
CRISPY_TEMPLATE_PACK = "bootstrap4"
#CRISPY_TEMPLATE_PACK = 'bootstrap4'
#CRISPY_TEMPLATE_PACK = 'uni_form'
#CRISPY_ALLOWED_TEMPLATE_PACKS = "tailwind"
#CRISPY_TEMPLATE_PACK = "tailwind"
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',
]
#CORS_ALLOW_CREDENTIALS = True
#CSRF_COOKIE_SECURE = True
CSRF_TRUSTED_ORIGINS = [
"https://argideli.com",
"https://dash.argideli.com",
"https://*.argideli.com/*",
"https://*.argideli.com/*/*",
"https://*.argideli.com/*/*/*",
"https://*.argideli.com/*/*/*/*",
"https://*.argideli.com/*/*/*/*/*",
"https://*.argideli.com/*/*/*/*/*/*",
"https://*.argideli.com/*/*/*/*/*/*",
]
#CSRF_COOKIE_DOMAIN = [
# 'https://argideli.com',
# 'https://dash.argideli.com']
#CSRF_COOKIE_NAME = "XSRF-TOKEN"
#CSRF_COOKIE_NAME = "csrftoken"
#CSRF_COOKIE_PATH = ['https://argideli.com', 'https://dash.argideli.com']
#SESSION_COOKIE_DOMAIN = ['https://argideli.com', 'https://dash.argideli.com']
ROOT_URLCONF = 'SpitiGlykou.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates']
,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
#LOGIN_REDIRECT_URL = '/dx'
LOGOUT_REDIRECT_URL = '/dx'
WSGI_APPLICATION = 'SpitiGlykou.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
"default": dj_database_url.config(
# default="postgres://postgres:123%21%40%23qweQWR%40@localhost:5432/spitiglykou", conn_max_age=600
#default="postgres://postgres:123%21%40%23qweQWR%40@10.10.10.1:5432/spitiglykou", conn_max_age=600
#default="postgres://spitiglykou:123%21%40%23qweQWR%40@10.10.10.1:5432/spitiglykou", conn_max_age=600
default="postgres://spitiglykou:123%21%40%23qweQWRT%23@localhost:5432/spitiglykou", conn_max_age=600
)
}
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": "spitiglykou",
"USER": "spitiglykou",
"PASSWORD": "123%21%40%23qweQWRT%23",
"HOST": "localhost",
"PORT": "5432",
}
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
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',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/
LANGUAGE_CODE = 'el-GR'
TIME_ZONE = 'Europe/Athens'
USE_I18N = True
USE_L10N = True
USE_TZ = True
#EMAIL_HOST = 'smtp.mvpsports.gr'
#EMAIL_HOST_USER ='info@mvpsports.gr'
#EMAIL_HOST_PASSWORD = '123!@#NFO1!'
#EMAIL_PORT = 587
#EMAIL_USE_TLS = True
#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
#LIST_OF_EMAIL_RECIPIENTS = 'argideli@mvpsports.gr'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = 'static'
MEDIA_URL = '/media/'
MEDIA_ROOT = 'media'
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
#STATICFILES_DIRS = (
# os.path.join(SITE_ROOT, 'static/'),
#)