Changeset View
Changeset View
Standalone View
Standalone View
src/djangox_project/settings.py
- This file was added.
""" | |||||
Django settings for djangox_project project. | |||||
Generated by 'django-admin startproject' using Django 2.2.0 | |||||
For more information on this file, see | |||||
https://docs.djangoproject.com/en/2.2/topics/settings/ | |||||
For the full list of settings and their values, see | |||||
https://docs.djangoproject.com/en/2.2/ref/settings/ | |||||
""" | |||||
import os | |||||
# 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 | |||||
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ | |||||
# SECURITY WARNING: keep the secret key used in production secret! | |||||
SECRET_KEY = '43)%4yx)aa@a=+_c(fn&kf3g29xax+=+a&key9i=!98zyim=8j' | |||||
# SECURITY WARNING: don't run with debug turned on in production! | |||||
DEBUG = True | |||||
ALLOWED_HOSTS = [] | |||||
# 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', | |||||
# Third-party | |||||
'allauth', | |||||
'allauth.account', | |||||
'crispy_forms', | |||||
'debug_toolbar', | |||||
# Local | |||||
'users', | |||||
'pages', | |||||
] | |||||
MIDDLEWARE = [ | |||||
'django.middleware.security.SecurityMiddleware', | |||||
'django.contrib.sessions.middleware.SessionMiddleware', | |||||
'django.middleware.common.CommonMiddleware', | |||||
'debug_toolbar.middleware.DebugToolbarMiddleware', | |||||
'django.middleware.csrf.CsrfViewMiddleware', | |||||
'django.contrib.auth.middleware.AuthenticationMiddleware', | |||||
'django.contrib.messages.middleware.MessageMiddleware', | |||||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | |||||
] | |||||
ROOT_URLCONF = 'djangox_project.urls' | |||||
TEMPLATES = [ | |||||
{ | |||||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | |||||
'DIRS': ['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', | |||||
], | |||||
}, | |||||
}, | |||||
] | |||||
WSGI_APPLICATION = 'djangox_project.wsgi.application' | |||||
# Database | |||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases | |||||
DATABASES = { | |||||
'default': { | |||||
'ENGINE': 'django.db.backends.sqlite3', | |||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | |||||
} | |||||
} | |||||
# Password validation | |||||
# https://docs.djangoproject.com/en/2.2/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/2.2/topics/i18n/ | |||||
LANGUAGE_CODE = 'en-us' | |||||
TIME_ZONE = 'UTC' | |||||
USE_I18N = True | |||||
USE_L10N = True | |||||
USE_TZ = True | |||||
# Static files (CSS, JavaScript, Images) | |||||
# https://docs.djangoproject.com/en/2.2/howto/static-files/ | |||||
STATIC_URL = '/static/' | |||||
STATICFILES_DIRS = [ | |||||
os.path.join(BASE_DIR, "static") | |||||
] | |||||
CRISPY_TEMPLATE_PACK = 'bootstrap4' | |||||
# Enabled for django-debug-toolbar to work | |||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#internal-ips | |||||
INTERNAL_IPS = ['127.0.0.1'] | |||||
AUTH_USER_MODEL = 'users.CustomUser' | |||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | |||||
# Django-Allauth Config | |||||
LOGIN_REDIRECT_URL = 'home' | |||||
ACCOUNT_LOGOUT_REDIRECT_URL = 'home' | |||||
AUTHENTICATION_BACKENDS = ( | |||||
"django.contrib.auth.backends.ModelBackend", | |||||
"allauth.account.auth_backends.AuthenticationBackend", | |||||
) | |||||
SITE_ID = 1 | |||||
ACCOUNT_SESSION_REMEMBER = True | |||||
ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE = False | |||||
ACCOUNT_USERNAME_REQUIRED = False | |||||
ACCOUNT_AUTHENTICATION_METHOD = 'email' | |||||
ACCOUNT_EMAIL_REQUIRED = True | |||||
ACCOUNT_UNIQUE_EMAIL = True |
Content licensed under Creative Commons Attribution-ShareAlike 3.0 (CC-BY-SA) unless otherwise noted; code licensed under GNU General Public License (GPL) or other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL