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',
58 'django.middleware.security.SecurityMiddleware',
59 'django.contrib.sessions.middleware.SessionMiddleware',
60 'django.middleware.common.CommonMiddleware',
61 'django.middleware.csrf.CsrfViewMiddleware',
62 'django.contrib.auth.middleware.AuthenticationMiddleware',
63 'django.contrib.messages.middleware.MessageMiddleware',
64 'django.middleware.clickjacking.XFrameOptionsMiddleware',
67 ROOT_URLCONF = 'styx.urls'
71 'BACKEND': 'django.template.backends.django.DjangoTemplates',
75 'context_processors': [
76 'django.template.context_processors.debug',
77 'django.template.context_processors.request',
78 'django.contrib.auth.context_processors.auth',
79 'django.contrib.messages.context_processors.messages',
85 WSGI_APPLICATION = 'styx.wsgi.application'
89 # https://docs.djangoproject.com/en/3.1/ref/settings/#databases
94 'ENGINE': 'django.db.backends.sqlite3',
95 'NAME': BASE_DIR / 'db.sqlite3',
101 'ENGINE': 'django.db.backends.postgresql_psycopg2',
105 'PASSWORD': LOCAL_SETTINGS['DB_PASSWORD'],
110 # Password validation
111 # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
113 AUTH_PASSWORD_VALIDATORS = [
115 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
118 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
121 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
124 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
129 # Internationalization
130 # https://docs.djangoproject.com/en/3.1/topics/i18n/
132 LANGUAGE_CODE = 'en-us'
143 # Static files (CSS, JavaScript, Images)
144 # https://docs.djangoproject.com/en/3.1/howto/static-files/
146 STATIC_URL = '/static/'
147 STATIC_ROOT = os.path.join(BASE_DIR, 'static/')