· 9 years ago · Jan 06, 2017, 06:10 PM
1"""
2Django settings for Bloghack project.
3
4Generated by 'django-admin startproject' using Django 1.10.4.
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 = '0aafci8#ibn0@@sh-f@dkok9ore3!^e^d+gi6$qwqp#8v=qvwr'
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 'blogpost',
35 'users',
36 'search',
37 'django.contrib.admin',
38 'django.contrib.auth',
39 'django.contrib.contenttypes',
40 'django.contrib.sessions',
41 'django.contrib.messages',
42 'django.contrib.staticfiles',
43 'django.contrib.sites',
44 'allauth',
45 'allauth.account',
46 'allauth.socialaccount',
47 'allauth.socialaccount.providers.facebook',
48 'ckeditor',
49 'ckeditor_uploader',
50]
51
52MIDDLEWARE = [
53 'django.middleware.security.SecurityMiddleware',
54 'django.contrib.sessions.middleware.SessionMiddleware',
55 'django.middleware.common.CommonMiddleware',
56 'django.middleware.csrf.CsrfViewMiddleware',
57 'django.contrib.auth.middleware.AuthenticationMiddleware',
58 'django.contrib.messages.middleware.MessageMiddleware',
59 'django.middleware.clickjacking.XFrameOptionsMiddleware',
60]
61
62ROOT_URLCONF = 'Bloghack.urls'
63CKEDITOR_UPLOAD_PATH = 'uploads/'
64CKEDITOR_IMAGE_BACKEND = 'pillow'
65CKEDITOR_JQUERY_URL = (
66 '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'
67)
68CKEDITOR_UPLOAD_SLUGIFY_FILENAME = False
69CKEDITOR_RESTRICT_BY_USER = True
70
71TEMPLATES = [
72 {
73 'BACKEND': 'django.template.backends.django.DjangoTemplates',
74 'DIRS': ['blogpost/templates',
75 ],
76 'APP_DIRS': True,
77 'OPTIONS': {
78 'context_processors': [
79 'django.template.context_processors.debug',
80 'django.template.context_processors.request',
81 'django.contrib.auth.context_processors.auth',
82 'django.contrib.messages.context_processors.messages',
83 ],
84 },
85 },
86]
87
88WSGI_APPLICATION = 'Bloghack.wsgi.application'
89
90
91AUTHENTICATION_BACKENDS = (
92 'django.contrib.auth.backends.ModelBackend',
93 'allauth.account.auth_backends.AuthenticationBackend',
94)
95
96
97# Database
98# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
99
100
101
102# Password validation
103# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
104
105AUTH_PASSWORD_VALIDATORS = [
106 {
107 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
108 },
109 {
110 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
111 },
112 {
113 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
114 },
115 {
116 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
117 },
118]
119
120
121# Internationalization
122# https://docs.djangoproject.com/en/1.10/topics/i18n/
123
124LANGUAGE_CODE = 'en-us'
125
126TIME_ZONE = 'UTC'
127
128USE_I18N = True
129
130USE_L10N = True
131
132USE_TZ = True
133
134
135# Static files (CSS, JavaScript, Images)
136# https://docs.djangoproject.com/en/1.10/howto/static-files/
137
138SITE_ID = 1
139
140STATIC_URL = '/static/'
141
142STATIC_ROOT = os.path.join(BASE_DIR, 'static')
143
144MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
145
146MEDIA_URL = '/media/'
147
148AUTH_USER_MODEL = 'users.NormalUser'
149
150DATABASES = {
151 'default': {
152 'ENGINE': 'django.db.backends.sqlite3',
153 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
154 }
155}