· 9 years ago · Aug 10, 2016, 09:54 PM
1"""
2Django settings for careergrowr project.
3
4For more information on this file, see
5https://docs.djangoproject.com/en/1.7/topics/settings/
6
7For the full list of settings and their values, see
8https://docs.djangoproject.com/en/1.7/ref/settings/
9"""
10
11# -*- coding: utf-8 -*-
12
13from django.utils.translation import ugettext_lazy as _
14import os, sys
15
16# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
17import os
18BASE_DIR = os.path.dirname(os.path.dirname(__file__))
19
20PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
21
22# Import Project Modules
23modules = os.path.join(PROJECT_ROOT, './modules/')
24sys.path.append(modules)
25# Import Application libraries
26lib = os.path.join(PROJECT_ROOT, './lib/')
27sys.path.append(lib)
28
29
30KEYWORDS = "online cv, online resume, cv, resume, professional resume, cv template, resume template, how to write a cv, how to write a resume, professional resume template"
31KEYWORDS_SHORT = "online resume, online cv, professional resume, resume template"
32DESCRIPTION = "Build a professional cv / resume with competence test, to improve your hiring chances "
33PAGE_TITLE = "Build a professional online CV / RESUME"
34
35ADMINS = (
36 ('Ales Maticic', 'gospodarprstanov@gmail.com'),
37)
38
39PROJECT_NAME = 'CarrerGrowr'
40PROJECT_URL = 'http://www.careergrowr.com'
41
42# Quick-start development settings - unsuitable for production
43# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
44
45# SECURITY WARNING: keep the secret key used in production secret!
46SECRET_KEY = 'y*%jc+d3hm70^#4(t1z!*z_8d&3ala2cw@napte*@hq8#aqf(_'
47
48# SECURITY WARNING: don't run with debug turned on in production!
49DEBUG = True
50
51TEMPLATE_DEBUG = True
52
53ALLOWED_HOSTS = []
54
55
56# Application definition
57
58INSTALLED_APPS = (
59 'django.contrib.admin',
60 'django.contrib.auth',
61 'django.contrib.contenttypes',
62 'django.contrib.sessions',
63 'django.contrib.sites',
64 'django.contrib.messages',
65 'django.contrib.staticfiles',
66 'django.contrib.flatpages',
67
68 'django_countries',
69 'ckeditor',
70 'mailer',
71 'taggit',
72 'easy_thumbnails',
73 'wkhtmltopdf',
74 'rest_framework',
75
76 'quiz',
77 'multichoice',
78 'true_false',
79 'essay',
80
81 'modules.accounts',
82 'modules.frontend',
83 'modules.news',
84 'modules.company',
85 'modules.jobapplication',
86
87
88)
89
90MIDDLEWARE_CLASSES = (
91 'modules.accounts.SetLastVisitMiddleware.SetLastVisitMiddleware',
92 'django.contrib.sessions.middleware.SessionMiddleware',
93 'django.middleware.common.CommonMiddleware',
94 'django.middleware.csrf.CsrfViewMiddleware',
95 'django.contrib.auth.middleware.AuthenticationMiddleware',
96 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
97 'django.contrib.messages.middleware.MessageMiddleware',
98 'django.middleware.clickjacking.XFrameOptionsMiddleware',
99)
100
101ROOT_URLCONF = 'careergrowr.urls'
102
103WSGI_APPLICATION = 'careergrowr.wsgi.application'
104
105import django.conf.global_settings as DEFAULT_SETTINGS
106
107TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
108 "frontend.context_processors.common_context",
109)
110
111# Database
112# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
113
114DATABASES = {
115 'default': {
116 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
117 'NAME': 'careergrowr', # Or path to database file if using sqlite3.
118 'USER': 'root', # Not used with sqlite3.
119 'PASSWORD': 'admin', # Not used with sqlite3.
120 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
121 'PORT': '', # Set to empty string for default. Not used with sqlite3.
122 'OPTIONS': {
123 'init_command': 'SET storage_engine=INNODB',
124 }
125 }
126}
127
128SITE_ID = 1
129
130# Internationalization
131# https://docs.djangoproject.com/en/1.7/topics/i18n/
132
133LANGUAGE_CODE = 'en-us'
134
135TIME_ZONE = 'Europe/Ljubljana'
136
137USE_I18N = True
138
139USE_L10N = True
140
141USE_TZ = True
142
143TEMPLATE_DIRS = (
144 os.path.join(PROJECT_ROOT, './templates/'),
145)
146
147AUTH_USER_MODEL = "accounts.EmailUser"
148
149LOGIN_URL = '/login/'
150LOGOUT_URL = '/'
151
152APPEND_SLASH = True
153PREPEND_WWW = True
154
155# email configuration
156#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
157EMAIL_BACKEND = "mailer.backend.DbBackend"
158EMAIL_USE_TLS = True
159EMAIL_HOST = 'smtp.challengefuture.org'
160
161#EMAIL_HOST_USER = 'happy@growr.net'
162#DEFAULT_FROM_EMAIL = 'happy@growr.net'
163#EMAIL_HOST_PASSWORD = '0G5Bge75GFtB4kF2'
164
165EMAIL_HOST_USER = 'challengefuture@growr.net'
166DEFAULT_FROM_EMAIL = 'challengefuture@growr.net'
167EMAIL_HOST_PASSWORD = '5C0pFsDN4kn3j5db'
168
169EMAIL_PORT = 587
170
171
172SERVER_EMAIL = 'webmaster@growr.net'
173
174THUMBNAIL_ALIASES = {
175 '': {
176 'avatar_small_square': {'size': (150, 150), 'crop': True},
177 'avatar_big': {'size': (255, 0), 'crop': False},
178 'thumbnail_small': {'size': (90, 90), 'crop': True},
179 'thumbnail_big': {'size': (100, 0), 'crop': False},
180 'thumbnail_blog': {'size': (100, 100), 'crop': True},
181 'blog_big': {'size': (764, 0), 'crop': False},
182 'blog_small': {'size': (764, 300), 'crop': True},
183 },
184}
185
186MEDIA_ROOT = os.path.join(PROJECT_ROOT, './media/')
187#STATIC_ROOT = os.path.join(PROJECT_ROOT, './static/')
188
189MEDIA_URL = '/media/'
190
191STATIC_URL = '/static/'
192
193# Additional locations of static files
194STATICFILES_DIRS = (
195 # Put strings here, like "/home/html/static" or "C:/www/django/static".
196 # Always use forward slashes, even on Windows.
197 # Don't forget to use absolute paths, not relative paths.
198 os.path.join(PROJECT_ROOT, './static/'),
199)
200
201FILE_CHARSET = 'utf-8'
202
203CKEDITOR_UPLOAD_PATH = os.path.join(PROJECT_ROOT, './media/ck_uploads/')
204
205CKEDITOR_CONFIGS = {
206 'awesome_ckeditor': {
207 'toolbar': 'Basic',
208 },
209 'default': {
210 'toolbar': [
211 ['Bold', 'Italic', 'Underline','-','NumberedList','BulletedList','-','Outdent','Indent','Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo','Link','Unlink','Anchor','TextColor','BGColor', 'Source', ],
212 ],
213 'height': 300,
214 'width': '100%',
215 'htmlEncodeOutput': False,
216 'entities': False,
217 'disableNativeSpellChecker': False,
218 },
219}
220
221
222# uncomment for production
223"""REST_FRAMEWORK = {
224 'DEFAULT_PERMISSION_CLASSES': [
225 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
226 ]
227}"""
228
229#WKHTMLTOPDF_CMD_OPTIONS = {
230# 'quiet': True,
231#}
232REST_FRAMEWORK = {
233 'DEFAULT_PERMISSION_CLASSES': [
234 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
235 ]
236}
237
238try:
239 from local_settings import *
240except Exception, e:
241 import sys
242 print >> sys.stderr, e