· 5 years ago · Aug 01, 2020, 12:06 AM
1"""
2Django settings for prototype project.
3
4Generated by 'django-admin startproject' using Django 3.0.7.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/3.0/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/3.0/ref/settings/
11"""
12
13import os
14
15# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
18
19# Quick-start development settings - unsuitable for production
20# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23# SECRET_KEY = '48f))98wax&q(8@(u4w7g(psw&ywg(+w-trmgaf%^wserakig%'
24SECRET_KEY = os.environ.get('SECRET_KEY')
25
26# SECURITY WARNING: don't run with debug turned on in production!
27DEBUG = True
28
29ALLOWED_HOSTS = ['covers-management-prototype.herokuapp.com']
30
31
32# Application definition
33
34INSTALLED_APPS = [
35 'covers',
36 'crispy_forms',
37 'django.contrib.admin',
38 'django.contrib.auth',
39 'django.contrib.contenttypes',
40 'django.contrib.sessions',
41 'django.contrib.messages',
42 'django.contrib.staticfiles',
43]
44
45MIDDLEWARE = [
46 'django.middleware.security.SecurityMiddleware',
47 'django.contrib.sessions.middleware.SessionMiddleware',
48 'django.middleware.common.CommonMiddleware',
49 'django.middleware.csrf.CsrfViewMiddleware',
50 'django.contrib.auth.middleware.AuthenticationMiddleware',
51 'django.contrib.messages.middleware.MessageMiddleware',
52 'django.middleware.clickjacking.XFrameOptionsMiddleware',
53]
54
55ROOT_URLCONF = 'prototype.urls'
56
57TEMPLATES = [
58 {
59 'BACKEND': 'django.template.backends.django.DjangoTemplates',
60 'DIRS': [],
61 'APP_DIRS': True,
62 'OPTIONS': {
63 'context_processors': [
64 'django.template.context_processors.debug',
65 'django.template.context_processors.request',
66 'django.contrib.auth.context_processors.auth',
67 'django.contrib.messages.context_processors.messages',
68 ],
69 },
70 },
71]
72
73WSGI_APPLICATION = 'prototype.wsgi.application'
74
75
76# Database
77# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
78
79
80
81DATABASES = {
82 'default': {
83 'ENGINE': 'django.db.backends.postgresql',
84 'NAME': 'dagbqbnlscfugd',
85 'USER': 'jkjgnsjjejwibr',
86 'PASSWORD': 'f7bbe4d06217064c109d357d7f6157a551e3d5de2b665dcd31c01d8ca79e842d',
87 'HOST': 'ec2-34-233-186-251.compute-1.amazonaws.com',
88 'PORT': '5432',
89 }
90}
91
92AUTH_USER_MODEL = 'covers.Agent'
93
94# Password validation
95# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
96
97AUTH_PASSWORD_VALIDATORS = [
98 {
99 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
100 },
101 {
102 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
103 },
104 {
105 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
106 },
107 {
108 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
109 },
110]
111
112
113# Internationalization
114# https://docs.djangoproject.com/en/3.0/topics/i18n/
115
116LANGUAGE_CODE = 'en-us'
117
118TIME_ZONE = 'UTC'
119
120USE_I18N = True
121
122USE_L10N = True
123
124USE_TZ = True
125
126
127# Static files (CSS, JavaScript, Images)
128# https://docs.djangoproject.com/en/3.0/howto/static-files/
129
130STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
131STATIC_URL = '/static/'
132STATICFILES_DIRS = (
133 os.path.join(BASE_DIR, 'static/'),
134)
135CRISPY_TEMPLATE_PACK = 'bootstrap4'
136
137LOGIN_REDIRECT_URL = 'index'
138LOGIN_URL = 'login'
139
140STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
141DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
142
143