· 7 years ago · Jun 29, 2018, 10:18 PM
1File "/home/rickus/Documents/softwareProjects/211hospitality/suitsandtables/backend/virtualsuits/local/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py", line 432, in stored_name
2 raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)
3ValueError: Missing staticfiles manifest entry for 'inline.bundle.js'
4
5"""
6Django settings for suitsandtables project.
7
8Generated by 'django-admin startproject' using Django 1.11.10.
9
10For more information on this file, see
11https://docs.djangoproject.com/en/1.11/topics/settings/
12
13For the full list of settings and their values, see
14https://docs.djangoproject.com/en/1.11/ref/settings/
15"""
16
17import os
18from decouple import config, Csv
19import datetime
20
21# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
22BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
23
24
25# Quick-start development settings - unsuitable for production
26# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
27
28# SECURITY WARNING: keep the secret key used in production secret!
29SECRET_KEY = config('SECRET_KEY')
30
31# SECURITY WARNING: don't run with debug turned on in production!
32DEBUG = config('DEBUG', default=True, cast=bool)
33DEBUG_PROPAGATE_EXCEPTIONS = config('DEBUG_PROPAGATE_EXCEPTIONS', default=True, cast=bool)
34BLOCKEMAIL = config('BLOCKEMAIL', default=True, cast=bool)
35
36ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())
37
38# send grid email code
39
40EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
41EMAIL_USE_TLS = config('EMAIL_USE_TLS', default=True, cast=bool)
42EMAIL_HOST = config('EMAIL_HOST')
43EMAIL_PORT = config('EMAIL_PORT')
44EMAIL_HOST_USER = config('EMAIL_HOST_USER')
45EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')
46
47# Amazon S3 code
48
49AWS_UPLOAD_BUCKET = config('AWS_UPLOAD_BUCKET')
50
51AWS_UPLOAD_USERNAME = config('AWS_UPLOAD_USERNAME')
52
53AWS_UPLOAD_GROUP = config('AWS_UPLOAD_GROUP')
54
55AWS_UPLOAD_ROOT_URI = config('AWS_UPLOAD_ROOT_URI')
56
57# Google maps geocode api url and key
58
59googlemapsgeocodeurl = config('googlemapsgeocodeurl')
60googlemapsgeocodekey = config('googlemapsgeocodekey')
61googlemapsembedbaseurl = config('googlemapsembedbaseurl')
62
63#example request https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY
64
65emaillinks = {
66 'devroot': 'localhost:4200/',
67 'devserverroot': 'http://suitsandtables3.herokuapp.com/',
68 'productionroot': 'http://www.suitsandtables.com/',
69 'venueuserverify': 'user/venue/validate/',
70 'clientuserverify': 'user/client/validate/',
71 'suitsuserverify': 'user/suits/validate/',
72 'forgotpassword': 'user/forgot-password/validate/'
73}
74# Application definition
75
76INSTALLED_APPS = [
77 'django.contrib.admin',
78 'django.contrib.auth',
79 'django.contrib.contenttypes',
80 'django.contrib.sessions',
81 'django.contrib.messages',
82 'whitenoise.runserver_nostatic',
83 'django.contrib.staticfiles',
84 'rest_framework',
85 'storages',
86 'venues',
87 'suitsandtablessettingsapp',
88 'Requestforproposal',
89 'rest_framework_jwt',
90 'STuser'
91]
92
93MIDDLEWARE = [
94 'django.middleware.security.SecurityMiddleware',
95 'whitenoise.middleware.WhiteNoiseMiddleware',
96 'django.contrib.sessions.middleware.SessionMiddleware',
97 'django.middleware.common.CommonMiddleware',
98 'django.middleware.csrf.CsrfViewMiddleware',
99 'django.contrib.auth.middleware.AuthenticationMiddleware',
100 'django.contrib.messages.middleware.MessageMiddleware',
101 'django.middleware.clickjacking.XFrameOptionsMiddleware',
102
103]
104
105ROOT_URLCONF = 'suitsandtables.urls'
106
107TEMPLATES = [
108 {
109 'BACKEND': 'django.template.backends.django.DjangoTemplates',
110 'DIRS': ['suitsandtables/templates',
111 'stemail/templates'],
112 'APP_DIRS': True,
113 'OPTIONS': {
114 'context_processors': [
115 'django.template.context_processors.debug',
116 'django.template.context_processors.request',
117 'django.contrib.auth.context_processors.auth',
118 'django.contrib.messages.context_processors.messages',
119 ],
120 },
121 },
122]
123
124WSGI_APPLICATION = 'suitsandtables.wsgi.application'
125
126AUTH_USER_MODEL = 'STuser.STUser'
127
128
129# Database
130# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
131
132DATABASES = {
133 'default': {
134 'ENGINE': 'django.db.backends.postgresql_psycopg2',
135 'NAME': config('DBNAME'),
136 'USER': config('DBUSER'),
137 'PASSWORD': config('DBPASSWORD'),
138 'HOST': config('DBHOST'),
139 'PORT': config('DBPORT'),
140 }
141}
142
143#REST Framework
144REST_FRAMEWORK = {
145 'DEFAULT_AUTHENTICATION_CLASSES':(
146 'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
147 'rest_framework.authentication.SessionAuthentication',
148 'rest_framework.authentication.BasicAuthentication',
149 ),
150}
151
152
153#JWT settings
154
155JWT_AUTH = {
156 'JWT_ENCODE_HANDLER':
157 'rest_framework_jwt.utils.jwt_encode_handler',
158
159 'JWT_DECODE_HANDLER':
160 'rest_framework_jwt.utils.jwt_decode_handler',
161
162 'JWT_PAYLOAD_HANDLER':
163 'rest_framework_jwt.utils.jwt_payload_handler',
164
165 'JWT_PAYLOAD_GET_USER_ID_HANDLER':
166 'rest_framework_jwt.utils.jwt_get_user_id_from_payload_handler',
167
168 'JWT_RESPONSE_PAYLOAD_HANDLER':
169 'rest_framework_jwt.utils.jwt_response_payload_handler',
170
171 'JWT_SECRET_KEY': SECRET_KEY,
172 'JWT_GET_USER_SECRET_KEY': None,
173 'JWT_PUBLIC_KEY': None,
174 'JWT_PRIVATE_KEY': None,
175 'JWT_ALGORITHM': 'HS256',
176 'JWT_VERIFY': False,
177 'JWT_VERIFY_EXPIRATION': False,
178 'JWT_LEEWAY': 0,
179 'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=20),
180 'JWT_AUDIENCE': None,
181 'JWT_ISSUER': None,
182
183 'JWT_ALLOW_REFRESH': True,
184 'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=30),
185
186 'JWT_AUTH_HEADER_PREFIX': 'JWT',
187 'JWT_AUTH_COOKIE': None,
188
189}
190
191
192# Password validation
193# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
194
195AUTH_PASSWORD_VALIDATORS = [
196 {
197 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
198 },
199 {
200 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
201 },
202 {
203 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
204 },
205 {
206 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
207 },
208]
209
210
211# Internationalization
212# https://docs.djangoproject.com/en/1.11/topics/i18n/
213
214LANGUAGE_CODE = 'en-us'
215
216TIME_ZONE = 'UTC'
217
218USE_I18N = True
219
220USE_L10N = True
221
222USE_TZ = True
223
224
225#angular distro root
226ANGULAR_APP_DIR = os.path.join(BASE_DIR, 'frontend/dist/')
227#image distro root
228ASSETS_DIR = os.path.join(BASE_DIR, 'frontend/dist/assets/')
229
230
231# Static files (CSS, JavaScript, Images)
232# https://docs.djangoproject.com/en/1.11/howto/static-files/
233#STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
234#STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
235STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
236STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
237STATIC_URL = '/static/'
238
239STATICFILES_DIRS = [
240 os.path.join(ANGULAR_APP_DIR),
241 os.path.join(ASSETS_DIR),
242
243]