· 8 years ago · Jan 15, 2018, 04:10 PM
1"""
2Django settings for tango_with_django_project project.
3
4Generated by 'django-admin startproject' using Django 1.9.1.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/1.9/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/1.9/ref/settings/
11"""
12
13import os
14import posixpath
15
16# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
17BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
18
19TEMPLATE_DIR = os.path.join(BASE_DIR,'templates')
20
21STATIC_DIR = os.path.join(BASE_DIR,'static')
22
23MEDIA_DIR = os.path.join(BASE_DIR,'media')
24
25# Quick-start development settings - unsuitable for production
26# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
27
28# SECURITY WARNING: keep the secret key used in production secret!
29SECRET_KEY = '4c7a071f-c997-4dfd-9e1a-da0d21ea3d6d'
30
31# SECURITY WARNING: don't run with debug turned on in production!
32DEBUG = True
33
34ALLOWED_HOSTS = []
35
36
37# Application definition
38
39INSTALLED_APPS = [
40 'app',
41 # Add your apps here to enable them
42 'django.contrib.admin',
43 'django.contrib.auth',
44 'django.contrib.contenttypes',
45 'django.contrib.sessions',
46 'django.contrib.messages',
47 'django.contrib.staticfiles',
48 'rango',
49]
50
51MIDDLEWARE_CLASSES = [
52 'django.middleware.security.SecurityMiddleware',
53 'django.contrib.sessions.middleware.SessionMiddleware',
54 'django.middleware.common.CommonMiddleware',
55 'django.middleware.csrf.CsrfViewMiddleware',
56 'django.contrib.auth.middleware.AuthenticationMiddleware',
57 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
58 'django.contrib.messages.middleware.MessageMiddleware',
59 'django.middleware.clickjacking.XFrameOptionsMiddleware',
60]
61
62ROOT_URLCONF = 'tango_with_django_project.urls'
63
64TEMPLATES = [
65 {
66 'BACKEND': 'django.template.backends.django.DjangoTemplates',
67 'DIRS': [TEMPLATE_DIR,],
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 'django.template.context_processors.media',
76 ],
77 },
78 },
79]
80
81STATICFILES_DIRS = [STATIC_DIR,]
82
83WSGI_APPLICATION = 'tango_with_django_project.wsgi.application'
84
85
86# Database
87# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
88
89DATABASES = {
90 'default': {
91 'ENGINE': 'django.db.backends.sqlite3',
92 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
93 }
94}
95
96
97# Password validation
98# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
99
100AUTH_PASSWORD_VALIDATORS = [
101 {
102 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
103 },
104 {
105 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
106 },
107 {
108 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
109 },
110 {
111 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
112 },
113]
114
115
116# Internationalization
117# https://docs.djangoproject.com/en/1.9/topics/i18n/
118
119LANGUAGE_CODE = 'en-us'
120
121TIME_ZONE = 'UTC'
122
123USE_I18N = True
124
125USE_L10N = True
126
127USE_TZ = True
128
129
130# Static files (CSS, JavaScript, Images)
131# https://docs.djangoproject.com/en/1.9/howto/static-files/
132
133STATIC_URL = '/static/'
134
135#STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['static']))
136STATIC_ROOT = []
137
138MEDIA_ROOT = MEDIA_DIR
139MEDIA_URL = '/media/'