· 7 years ago · Aug 10, 2018, 11:38 AM
1"""
2Django settings for djangovue2 project.
3
4Generated by 'django-admin startproject' using Django 2.0.5.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/2.0/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/2.0/ref/settings/
11"""
12
13import os
14import json
15from six.moves.urllib import request
16from cryptography.x509 import load_pem_x509_certificate
17from cryptography.hazmat.backends import default_backend
18from django.conf import settings
19from django.conf.urls.static import static
20
21
22# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
23BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
24
25
26# Quick-start development settings - unsuitable for production
27# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
28
29# SECURITY WARNING: keep the secret key used in production secret!
30SECRET_KEY = 'yuj2elivti*ml&qcbz!=!6ujbl+)k%*+c)il&r6qw$)88+#qm!'
31
32# SECURITY WARNING: don't run with debug turned on in production!
33DEBUG = True
34
35ALLOWED_HOSTS = []
36
37
38# Application definition
39
40INSTALLED_APPS = [
41 'django.contrib.admin',
42 'django.contrib.auth',
43 'django.contrib.contenttypes',
44 'django.contrib.sessions',
45 'django.contrib.messages',
46 'django.contrib.staticfiles',
47 'catalog',
48 'rest_framework',
49 'rest_framework_jwt',
50 'corsheaders',
51 'webpack_loader',
52]
53
54MIDDLEWARE = [
55 'django.middleware.security.SecurityMiddleware',
56 'django.contrib.sessions.middleware.SessionMiddleware',
57 'django.middleware.common.CommonMiddleware',
58 'django.middleware.csrf.CsrfViewMiddleware',
59 'django.contrib.auth.middleware.AuthenticationMiddleware',
60 'django.contrib.messages.middleware.MessageMiddleware',
61 'django.middleware.clickjacking.XFrameOptionsMiddleware',
62 'corsheaders.middleware.CorsMiddleware',
63 'django.middleware.common.CommonMiddleware',
64]
65
66ROOT_URLCONF = 'djangovue2.urls'
67
68TEMPLATES = [
69 {
70 'BACKEND': 'django.template.backends.django.DjangoTemplates',
71 'DIRS': [BASE_DIR],
72 'APP_DIRS': True,
73 'OPTIONS': {
74 'context_processors': [
75 'django.template.context_processors.debug',
76 'django.template.context_processors.request',
77 'django.contrib.auth.context_processors.auth',
78 'django.contrib.messages.context_processors.messages',
79 ],
80 },
81 },
82]
83
84WSGI_APPLICATION = 'djangovue2.wsgi.application'
85
86
87# Database
88# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
89
90DATABASES = {
91 'default': {
92 'ENGINE': 'django.db.backends.sqlite3',
93 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
94 }
95}
96
97
98# Password validation
99# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
100
101AUTH_PASSWORD_VALIDATORS = [
102 {
103 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
104 },
105 {
106 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
107 },
108 {
109 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
110 },
111 {
112 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
113 },
114]
115
116
117# Internationalization
118# https://docs.djangoproject.com/en/2.0/topics/i18n/
119
120LANGUAGE_CODE = 'en-us'
121
122TIME_ZONE = 'UTC'
123
124USE_I18N = True
125
126USE_L10N = True
127
128USE_TZ = True
129
130
131# Static files (CSS, JavaScript, Images)
132# https://docs.djangoproject.com/en/2.0/howto/static-files/
133
134STATIC_URL = '/static/'
135STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
136
137STATICFILES_DIRS = (
138
139 os.path.join(BASE_DIR, 'dist'),
140)
141#WEBPACK_LOADER = {
142# 'DEFAULT': {
143# 'CACHE': not DEBUG,
144# 'BUNDLE_DIR_NAME': '',
145# 'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json'),
146# 'POLL_INTERVAL': 0.1,
147# 'TIMEOUT': None,
148# 'IGNORE': ['.+\.hot-update.js', '.+\.map']
149# }
150#}
151
152WEBPACK_LOADER = {
153 'DEFAULT': {
154 'BUNDLE_DIR_NAME': '',
155 'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json'),
156 }
157}