· 10 years ago · Apr 16, 2016, 01:45 PM
1BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
2
3
4# Quick-start development settings - unsuitable for production
5# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
6
7# SECURITY WARNING: keep the secret key used in production secret!
8SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
9
10# SECURITY WARNING: don't run with debug turned on in production!
11DEBUG = False
12
13#ALLOWED_HOSTS = ['.domainname.com']
14
15# Application definition
16
17INSTALLED_APPS = (
18 'django.contrib.auth',
19 'django.contrib.contenttypes',
20 'django.contrib.sessions',
21 'django.contrib.messages',
22 'django.contrib.staticfiles',
23 'articles',
24 'about',
25 'accounts',
26 'tinymce',
27 'registration',
28 'django.contrib.sites',
29 'django.contrib.flatpages',
30 'django.contrib.admin',
31)
32
33SITE_ID = 1
34
35MIDDLEWARE_CLASSES = (
36 'django.contrib.sessions.middleware.SessionMiddleware',
37 'django.middleware.common.CommonMiddleware',
38 'django.middleware.csrf.CsrfViewMiddleware',
39 'django.contrib.auth.middleware.AuthenticationMiddleware',
40 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
41 'django.contrib.messages.middleware.MessageMiddleware',
42 'django.middleware.clickjacking.XFrameOptionsMiddleware',
43 'django.middleware.security.SecurityMiddleware',
44)
45
46ROOT_URLCONF = 'blog.urls'
47
48TEMPLATES = [
49 {
50 'BACKEND': 'django.template.backends.django.DjangoTemplates',
51 'DIRS': [os.path.join(BASE_DIR, 'templates')],
52 'APP_DIRS': True,
53 'OPTIONS': {
54 'context_processors': [
55 'django.template.context_processors.debug',
56 'django.template.context_processors.request',
57 'django.contrib.auth.context_processors.auth',
58 'django.contrib.messages.context_processors.messages',
59 ],
60 },
61 },
62]
63
64WSGI_APPLICATION = 'blog.wsgi.application'
65
66# Database
67# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
68
69DATABASES = {
70 'default': {
71 'ENGINE': 'django.db.backends.sqlite3',
72 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
73 }
74}
75
76# Internationalization
77# https://docs.djangoproject.com/en/1.8/topics/i18n/
78LANGUAGE_CODE = 'en-us'
79TIME_ZONE = 'America/Chicago'
80USE_I18N = True
81USE_L10N = True
82USE_TZ = True
83
84# Static files (CSS, JavaScript, Images)
85# https://docs.djangoproject.com/en/1.8/howto/static-files/
86STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
87STATIC_URL = '/static/'
88STATIC_ROOT = os.path.join(BASE_DIR, 'static_root')
89
90MEDIA_URL = '/media/'
91MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
92
93TINYMCE_DEFAULT_CONFIG = {
94 'plugins' : "pagebreak, style, layer, table, save, advhr, advimage, advlink, emotions, iespell, inlinepopups, preview, media, searchreplace, print, contextmenu, paste, directionality, fullscreen, noneditable, visualchars, nonbreaking, xhtmlxtras, template, wordcount, advlist, autosave, pagebreak",
95 'theme': "advanced",
96 'theme_advanced_buttons1' : "bold, italic, underline, strikethrough, |, justifyleft, justifycenter, justifyright, justifyfull, fontselect, fontsizeselect, fullscreen, code,|, preview, image, media",
97 'theme_advanced_buttons2' : "table,|, bullist, numlist, |, outdent, indent, blockquote, |, undo, redo, |, link, unlink, |, forecolor, backcolor, |, pagebreak, paste, |, template",
98 'theme_advanced_toolbar_location' : "top",
99 'theme_advanced_toolbar_align' : "left",
100 'width': '80%',
101 'height': '400'
102}
103# Registration Settings
104ACCOUNT_ACTIVATION_DAYS = 5
105REGISTRATION_AUTO_LOGIN = True
106REGISTRATION_DEFAULT_FROM_EMAIL = "domainname.com"
107REGISTRATION_EMAIL_HTML = True
108LOGIN_REDIRECT_URL = '/'
109
110# Email Settings
111EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
112EMAIL_HOST = 'mail.domainname.com'
113EMAIL_PORT = '26'
114EMAIL_HOST_USER = 'admin@domainname.com'
115EMAIL_HOST_PASSWORD = 'xxxxxxxxxx'
116
117# Deployment Settings
118USE_SSL = True
119SECURE_CONTENT_TYPE_NOSNIFF = True
120SECURE_BROWSER_XSS_FILTER = True
121SESSION_COOKIE_SECURE = True
122CSRF_COOKIE_SECURE = True
123CSRF_COOKIE_HTTPONLY = True
124X_FRAME_OPTIONS = 'DENY'
125
126# Error Logging
127ADMINS = [('admin', 'admin@domainname.com')]
128MANAGERS = ADMINS