· 7 years ago · Aug 06, 2018, 12:32 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
18
19# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
20BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
21
22
23# Quick-start development settings - unsuitable for production
24# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
25
26# SECURITY WARNING: keep the secret key used in production secret!
27SECRET_KEY = 'yuj2elivti*ml&qcbz!=!6ujbl+)k%*+c)il&r6qw$)88+#qm!'
28
29# SECURITY WARNING: don't run with debug turned on in production!
30DEBUG = True
31
32ALLOWED_HOSTS = []
33
34
35# Application definition
36
37INSTALLED_APPS = [
38 'django.contrib.admin',
39 'django.contrib.auth',
40 'django.contrib.contenttypes',
41 'django.contrib.sessions',
42 'django.contrib.messages',
43 'django.contrib.staticfiles',
44 'catalog',
45 'rest_framework',
46 'rest_framework_jwt',
47 'corsheaders',
48]
49
50MIDDLEWARE = [
51 'django.middleware.security.SecurityMiddleware',
52 'django.contrib.sessions.middleware.SessionMiddleware',
53 'django.middleware.common.CommonMiddleware',
54 'django.middleware.csrf.CsrfViewMiddleware',
55 'django.contrib.auth.middleware.AuthenticationMiddleware',
56 'django.contrib.messages.middleware.MessageMiddleware',
57 'django.middleware.clickjacking.XFrameOptionsMiddleware',
58 'corsheaders.middleware.CorsMiddleware',
59 'django.middleware.common.CommonMiddleware',
60]
61
62ROOT_URLCONF = 'djangovue2.urls'
63
64TEMPLATES = [
65 {
66 'BACKEND': 'django.template.backends.django.DjangoTemplates',
67 'DIRS': [os.path.join(BASE_DIR, 'templates')],
68 'APP_DIRS': True,
69 'OPTIONS': {
70 'context_processors': [
71 'django.template.context_processors.debug',
72 'django.template.context_processors.request',
73 'django.contrib.auth.context_processors.auth',
74 'django.contrib.messages.context_processors.messages',
75 ],
76 },
77 },
78]
79
80WSGI_APPLICATION = 'djangovue2.wsgi.application'
81
82
83# Database
84# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
85
86DATABASES = {
87 'default': {
88 'ENGINE': 'django.db.backends.sqlite3',
89 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
90 }
91}
92
93
94# Password validation
95# https://docs.djangoproject.com/en/2.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/2.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/2.0/howto/static-files/
129
130STATIC_URL = '/static/'
131
132
133REST_FRAMEWORK = {
134 'DEFAULT_PERMISSION_CLASSES': (
135 'rest_framework.permissions.IsAuthenticated',
136 ),
137 'DEFAULT_AUTHENTICATION_CLASSES': (
138 'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
139 ),
140}