· 9 years ago · Nov 09, 2016, 11:28 PM
1"""
2Django settings for tutorial project.
3
4Generated by 'django-admin startproject' using Django 1.10.3.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/1.10/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/1.10/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/1.10/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = '#&5!s82+$-@-7@)o6-4fxp@wi)$izcw=m-ij_j6n*q5h!7*#_$'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = []
29
30
31# Application definition
32
33INSTALLED_APPS = [
34 'corsheaders',
35 'django.contrib.admin',
36 'django.contrib.auth',
37 'django.contrib.contenttypes',
38 'django.contrib.sessions',
39 'django.contrib.messages',
40 'django.contrib.staticfiles',
41 'rest_framework',
42
43]
44
45
46REST_FRAMEWORK = {
47 'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.AllowAny',),
48 'PAGE_SIZE': 10
49}
50
51CORS_ORIGIN_ALLOW_ALL = True
52
53
54MIDDLEWARE = [
55 'corsheaders.middleware.CorsMiddleware',
56 'django.middleware.common.CommonMiddleware',
57 'django.middleware.security.SecurityMiddleware',
58 'django.contrib.sessions.middleware.SessionMiddleware',
59 'django.middleware.common.CommonMiddleware',
60 'django.middleware.csrf.CsrfViewMiddleware',
61 'django.contrib.auth.middleware.AuthenticationMiddleware',
62 'django.contrib.messages.middleware.MessageMiddleware',
63 'django.middleware.clickjacking.XFrameOptionsMiddleware',
64
65]
66
67ROOT_URLCONF = 'tutorial.urls'
68
69
70
71TEMPLATES = [
72 {
73 'BACKEND': 'django.template.backends.django.DjangoTemplates',
74 'DIRS': [],
75 'APP_DIRS': True,
76 'OPTIONS': {
77 'context_processors': [
78 'django.template.context_processors.debug',
79 'django.template.context_processors.request',
80 'django.contrib.auth.context_processors.auth',
81 'django.contrib.messages.context_processors.messages',
82 ],
83 },
84 },
85]
86
87WSGI_APPLICATION = 'tutorial.wsgi.application'
88
89
90# Database
91# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
92
93DATABASES = {
94 'default': {
95 'ENGINE': 'django.db.backends.sqlite3',
96 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
97 }
98}
99
100
101# Password validation
102# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
103
104AUTH_PASSWORD_VALIDATORS = [
105 {
106 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
107 },
108 {
109 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
110 },
111 {
112 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
113 },
114 {
115 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
116 },
117]
118
119
120# Internationalization
121# https://docs.djangoproject.com/en/1.10/topics/i18n/
122
123LANGUAGE_CODE = 'en-us'
124
125TIME_ZONE = 'UTC'
126
127USE_I18N = True
128
129USE_L10N = True
130
131USE_TZ = True
132
133
134# Static files (CSS, JavaScript, Images)
135# https://docs.djangoproject.com/en/1.10/howto/static-files/
136
137STATIC_URL = '/static/'