| 
1 | 1 | """  | 
2 | 2 | Django settings for mysite project.  | 
3 | 3 | 
  | 
 | 4 | +Generated by 'django-admin startproject' using Django 1.9.  | 
 | 5 | +
  | 
4 | 6 | For more information on this file, see  | 
5 |  | -https://docs.djangoproject.com/en/1.7/topics/settings/  | 
 | 7 | +https://docs.djangoproject.com/en/1.9/topics/settings/  | 
6 | 8 | 
  | 
7 | 9 | For the full list of settings and their values, see  | 
8 |  | -https://docs.djangoproject.com/en/1.7/ref/settings/  | 
 | 10 | +https://docs.djangoproject.com/en/1.9/ref/settings/  | 
9 | 11 | """  | 
10 | 12 | 
 
  | 
11 |  | -# Build paths inside the project like this: os.path.join(BASE_DIR, ...)  | 
12 | 13 | import os  | 
13 |  | -BASE_DIR = os.path.dirname(os.path.dirname(__file__))  | 
 | 14 | + | 
 | 15 | +# Build paths inside the project like this: os.path.join(BASE_DIR, ...)  | 
 | 16 | +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))  | 
14 | 17 | 
 
  | 
15 | 18 | 
 
  | 
16 | 19 | # Quick-start development settings - unsuitable for production  | 
17 |  | -# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/  | 
 | 20 | +# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/  | 
18 | 21 | 
 
  | 
19 | 22 | # SECURITY WARNING: keep the secret key used in production secret!  | 
20 |  | -SECRET_KEY = 'e@3=0i!#n4l25r*ul*sbx6b$@gh7a6pjee6lr-slw9!ayj#*@f'  | 
 | 23 | +SECRET_KEY = 'i=n^tc%@@gq#8ev6dlymy9+-%@^f!q54sjf0rvikt_k5bl(t1='  | 
21 | 24 | 
 
  | 
22 | 25 | # SECURITY WARNING: don't run with debug turned on in production!  | 
23 | 26 | DEBUG = True  | 
24 | 27 | 
 
  | 
25 |  | -TEMPLATE_DEBUG = True  | 
26 |  | - | 
27 | 28 | ALLOWED_HOSTS = []  | 
28 | 29 | 
 
  | 
29 | 30 | 
 
  | 
30 | 31 | # Application definition  | 
31 | 32 | 
 
  | 
32 |  | -INSTALLED_APPS = (  | 
 | 33 | +INSTALLED_APPS = [  | 
33 | 34 |     'django.contrib.admin',  | 
34 | 35 |     'django.contrib.auth',  | 
35 | 36 |     'django.contrib.contenttypes',  | 
36 | 37 |     'django.contrib.sessions',  | 
37 | 38 |     'django.contrib.messages',  | 
38 | 39 |     'django.contrib.staticfiles',  | 
39 | 40 |     'myblog',  | 
40 |  | -)  | 
 | 41 | +]  | 
41 | 42 | 
 
  | 
42 |  | -MIDDLEWARE_CLASSES = (  | 
 | 43 | +MIDDLEWARE_CLASSES = [  | 
 | 44 | +    'django.middleware.security.SecurityMiddleware',  | 
43 | 45 |     'django.contrib.sessions.middleware.SessionMiddleware',  | 
44 | 46 |     'django.middleware.common.CommonMiddleware',  | 
45 | 47 |     'django.middleware.csrf.CsrfViewMiddleware',  | 
46 | 48 |     'django.contrib.auth.middleware.AuthenticationMiddleware',  | 
47 | 49 |     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',  | 
48 | 50 |     'django.contrib.messages.middleware.MessageMiddleware',  | 
49 | 51 |     'django.middleware.clickjacking.XFrameOptionsMiddleware',  | 
50 |  | -)  | 
 | 52 | +]  | 
51 | 53 | 
 
  | 
52 | 54 | ROOT_URLCONF = 'mysite.urls'  | 
53 | 55 | 
 
  | 
 | 56 | +TEMPLATES = [  | 
 | 57 | +    {  | 
 | 58 | +        'BACKEND': 'django.template.backends.django.DjangoTemplates',  | 
 | 59 | +        'DIRS': [os.path.join(BASE_DIR, 'mysite/templates')],  | 
 | 60 | +        'APP_DIRS': True,  | 
 | 61 | +        'OPTIONS': {  | 
 | 62 | +            'context_processors': [  | 
 | 63 | +                'django.template.context_processors.debug',  | 
 | 64 | +                'django.template.context_processors.request',  | 
 | 65 | +                'django.contrib.auth.context_processors.auth',  | 
 | 66 | +                'django.contrib.messages.context_processors.messages',  | 
 | 67 | +            ],  | 
 | 68 | +        },  | 
 | 69 | +    },  | 
 | 70 | +]  | 
 | 71 | + | 
54 | 72 | WSGI_APPLICATION = 'mysite.wsgi.application'  | 
55 | 73 | 
 
  | 
56 | 74 | 
 
  | 
57 | 75 | # Database  | 
58 |  | -# https://docs.djangoproject.com/en/1.7/ref/settings/#databases  | 
 | 76 | +# https://docs.djangoproject.com/en/1.9/ref/settings/#databases  | 
59 | 77 | 
 
  | 
60 | 78 | DATABASES = {  | 
61 | 79 |     'default': {  | 
 | 
64 | 82 |     }  | 
65 | 83 | }  | 
66 | 84 | 
 
  | 
 | 85 | + | 
 | 86 | +# Password validation  | 
 | 87 | +# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators  | 
 | 88 | + | 
 | 89 | +AUTH_PASSWORD_VALIDATORS = [  | 
 | 90 | +    {  | 
 | 91 | +        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',  | 
 | 92 | +    },  | 
 | 93 | +    {  | 
 | 94 | +        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',  | 
 | 95 | +    },  | 
 | 96 | +    {  | 
 | 97 | +        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',  | 
 | 98 | +    },  | 
 | 99 | +    {  | 
 | 100 | +        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',  | 
 | 101 | +    },  | 
 | 102 | +]  | 
 | 103 | + | 
 | 104 | + | 
67 | 105 | # Internationalization  | 
68 |  | -# https://docs.djangoproject.com/en/1.7/topics/i18n/  | 
 | 106 | +# https://docs.djangoproject.com/en/1.9/topics/i18n/  | 
69 | 107 | 
 
  | 
70 | 108 | LANGUAGE_CODE = 'en-us'  | 
71 | 109 | 
 
  | 
 | 
79 | 117 | 
 
  | 
80 | 118 | 
 
  | 
81 | 119 | # Static files (CSS, JavaScript, Images)  | 
82 |  | -# https://docs.djangoproject.com/en/1.7/howto/static-files/  | 
 | 120 | +# https://docs.djangoproject.com/en/1.9/howto/static-files/  | 
83 | 121 | 
 
  | 
84 | 122 | STATIC_URL = '/static/'  | 
85 | 123 | 
 
  | 
86 |  | - | 
87 |  | -TEMPLATE_DIRS = (os.path.join(BASE_DIR, 'mysite/templates'), )  | 
88 | 124 | LOGIN_URL = '/login/'  | 
89 | 125 | LOGIN_REDIRECT_URL = '/'  | 
0 commit comments