2 Django settings for styx project.
4 Generated by 'django-admin startproject' using Django 3.1.
6 For more information on this file, see
7 https://docs.djangoproject.com/en/3.1/topics/settings/
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/3.1/ref/settings/
13 from pathlib import Path
17 # Build paths inside the project like this: BASE_DIR / 'subdir'.
18 BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
21 # Quick-start development settings - unsuitable for production
22 # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
25 with open(os.path.expanduser('~/.styxrc'), 'r') as styxrc:
26 LOCAL_SETTINGS = json.loads(styxrc.read())
28 except FileNotFoundError:
31 # SECURITY WARNING: don't run with debug turned on in production!
32 DEBUG = LOCAL_SETTINGS.get('DEBUG', True)
35 SECRET_KEY = 'mq@_9a6&y4nvgqa7obf-r%a4^dt)z=r8jr&91&=oc^6-=i0*$z'
37 SECRET_KEY = LOCAL_SETTINGS['SECRET_KEY']
46 # Application definition
49 'django.contrib.admin',
50 'django.contrib.auth',
51 'django.contrib.contenttypes',
52 'django.contrib.sessions',
53 'django.contrib.messages',
54 'django.contrib.staticfiles',
59 'django.middleware.security.SecurityMiddleware',
60 'django.contrib.sessions.middleware.SessionMiddleware',
61 'django.middleware.common.CommonMiddleware',
62 'django.middleware.csrf.CsrfViewMiddleware',
63 'django.contrib.auth.middleware.AuthenticationMiddleware',
64 'django.contrib.messages.middleware.MessageMiddleware',
65 'django.middleware.clickjacking.XFrameOptionsMiddleware',
68 ROOT_URLCONF = 'styx.urls'
72 'BACKEND': 'django.template.backends.django.DjangoTemplates',
76 'context_processors': [
77 'django.template.context_processors.debug',
78 'django.template.context_processors.request',
79 'django.contrib.auth.context_processors.auth',
80 'django.contrib.messages.context_processors.messages',
86 WSGI_APPLICATION = 'styx.wsgi.application'
90 # https://docs.djangoproject.com/en/3.1/ref/settings/#databases
95 'ENGINE': 'django.db.backends.sqlite3',
96 'NAME': BASE_DIR / 'db.sqlite3',
102 'ENGINE': 'django.db.backends.postgresql_psycopg2',
106 'PASSWORD': LOCAL_SETTINGS['DB_PASSWORD'],
111 # Password validation
112 # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
114 AUTH_PASSWORD_VALIDATORS = [
116 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
119 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
122 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
125 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
130 # Internationalization
131 # https://docs.djangoproject.com/en/3.1/topics/i18n/
133 LANGUAGE_CODE = 'en-us'
144 # Static files (CSS, JavaScript, Images)
145 # https://docs.djangoproject.com/en/3.1/howto/static-files/
147 STATIC_URL = '/static/'
148 STATIC_ROOT = os.path.join(BASE_DIR, 'static/')