spacepaste

  1.  
  2. # Method that pulls settings from the standard settings.py
  3. # file so that you can append or override items.
  4. def get_setting(setting):
  5. try:
  6. from . import settings # Python 3
  7. except ImportError:
  8. import settings # Python 2
  9. return getattr(settings, setting)
  10. SECRET_KEY='0db97110a442d4dde680bbbc5b4e3ad3'
  11. SITE_SETTINGS_KEY='f0b73ca3e1dca73e9cfebfa1a5ae5e33'
  12. INSTALLED_APPS = get_setting('INSTALLED_APPS')
  13. INSTALLED_APPS = ('attendance','blog','django_comments_xtd','django_comments',) + INSTALLED_APPS
  14. COMMENTS_APP = 'django_comments'
  15. COMMENTS_XTD_MAX_THREAD_LEVEL = 8
  16. COMMENTS_XTD_CONFIRM_EMAIL = True
  17. SITE_ID = 1
  18. INSTALLED_APPS += (
  19. 'django.contrib.gis',
  20. 'tendenci.apps.committees',
  21. 'tendenci.apps.case_studies',
  22. 'tendenci.apps.donations',
  23. 'tendenci.apps.speakers',
  24. 'tendenci.apps.staff',
  25. 'tendenci.apps.studygroups',
  26. 'tendenci.apps.videos',
  27. 'tendenci.apps.testimonials',
  28. 'tendenci.apps.social_services',
  29. # -- explorer block --
  30. 'tendenci.apps.explorer_extensions',
  31. 'explorer',
  32. # -- end of explorer block --
  33. # --helpdesk --
  34. #'markdown_deux',
  35. #'bootstrapform',
  36. #'tendenci.apps.helpdesk',
  37. # -- end of helpdesk
  38. )
  39. USE_I18N = True
  40. ALLOWED_HOSTS = ["*"]
  41. SITE_MODE = 'prod'
  42. ADMINS = ()
  43. MANAGERS = ADMINS
  44. DATABASES = {
  45. 'default': {
  46. 'ENGINE': 'django.contrib.gis.db.backends.postgis',
  47. 'NAME': 'admin',
  48. 'HOST': 'localhost',
  49. 'USER': 'admin',
  50. 'PASSWORD': 'admin',
  51. 'PORT': 5432,
  52. 'AUTOCOMMIT': True,
  53. }
  54. }
  55. SSL_ENABLED = False
  56. CELERY_IS_ACTIVE = False
  57. # Logged in users may either be logged out when the user closes their
  58. # browser, or may remain logged in after the user closes and reopens
  59. # their browser.
  60. # For logins through /admin/login/, SESSION_EXPIRE_AT_BROWSER_CLOSE
  61. # controls this behavior.
  62. # For logins through /accounts/login/, the "Hide Remember Me" and
  63. # "Remember Me Checked" settings in the "Users" app in Tendenci control
  64. # this behavior, overriding SESSION_EXPIRE_AT_BROWSER_CLOSE.
  65. SESSION_EXPIRE_AT_BROWSER_CLOSE = False
  66. # Independently of that behavior, users will also be logged out by both
  67. # the server and their browser if they do not visit the site for more
  68. # than SESSION_COOKIE_AGE seconds. However, each page load will reset
  69. # this counter, allowing the user to remain logged in indefinitely as
  70. # long as they continue to visit the site regularly.
  71. SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # 2 weeks
  72. #SESSION_COOKIE_SECURE = True # Send Session Cookie over HTTPS only
  73. #CSRF_COOKIE_SECURE = True # Send CSRF Cookie over HTTPS only
  74. # Uncomment to properly detect HTTP vs HTTPS when running behind nginx.
  75. # DO NOT uncomment if not running behind nginx, as that will open a security
  76. # hole.
  77. #SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  78. # Local time zone for this installation. Choices can be found here:
  79. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  80. # although not all choices may be available on all operating systems.
  81. # In a Windows environment this must be set to your system time zone.
  82. TIME_ZONE = 'US/Central'
  83. # -------------------------------------- #
  84. # DEBUG OPTIONS
  85. # -------------------------------------- #
  86. SENTRY_DSN = ""
  87. if SENTRY_DSN:
  88. INSTALLED_APPS += ('raven.contrib.django.raven_compat',)
  89. RAVEN_CONFIG = {
  90. 'dsn': SENTRY_DSN,
  91. }
  92. # ---------------------------------------#
  93. # PAYMENT GATEWAY
  94. # ---------------------------------------#
  95. # authorizenet, firstdata (the first two)
  96. MERCHANT_LOGIN = ''
  97. MERCHANT_TXN_KEY = ''
  98. AUTHNET_MD5_HASH_VALUE = False
  99. # paypalpayflowlink (currently US only unfortunately per PayPal)
  100. PAYPAL_MERCHANT_LOGIN = ''
  101. PAYFLOWLINK_PARTNER = 'PayPal'
  102. # Uncomment when using the PayPal Sandbox
  103. #PAYPAL_POST_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr'
  104. # stripe
  105. STRIPE_SECRET_KEY = ''
  106. STRIPE_PUBLISHABLE_KEY = ''
  107. # -------------------------------------- #
  108. # EMAIL
  109. # -------------------------------------- #
  110. # remove or comment out this line once you have your email backend set up.
  111. EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
  112. # EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  113. # EMAIL_USE_TLS = False
  114. # EMAIL_HOST = None
  115. # EMAIL_PORT = 25
  116. # EMAIL_HOST_USER = None
  117. # EMAIL_HOST_PASSWORD = None
  118. #EMAIL_BACKEND = "django_ses.SESBackend"
  119. # AWS_ACCESS_KEY_ID = ''
  120. # AWS_SECRET_ACCESS_KEY = ''
  121. DEFAULT_FROM_EMAIL = "no-reply@example.com"
  122. SERVER_EMAIL = DEFAULT_FROM_EMAIL
  123. # -------------------------------------- #
  124. # CACHE
  125. # -------------------------------------- #
  126. SITE_CACHE_KEY = SECRET_KEY
  127. CACHE_PRE_KEY = SITE_CACHE_KEY
  128. CACHES = {
  129. 'default': {
  130. 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  131. }
  132. }
  133. # Local memcached requires memcached to be running locally.
  134. MEMCACHED_ENABLED = True
  135. if MEMCACHED_ENABLED:
  136. CACHES = {
  137. 'default': {
  138. 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
  139. 'LOCATION': "127.0.0.1:11211",
  140. }
  141. }
  142. CACHES['default']['TIMEOUT'] = 60 * 60 * 24 * 30 # 30 days
  143. # sql explorer only allows superuser
  144. EXPLORER_PERMISSION_VIEW = lambda u: u.is_superuser
  145. EXPLORER_PERMISSION_CHANGE = lambda u: u.is_superuser
  146. # helpdesk
  147. #HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT = True
  148. # debug mode
  149. DEBUG = True
  150. # Django Debug Toolbar for profiling (measuring CPU/SQL/cache/etc timing)
  151. # Set DEBUG_TOOLBAR_INSTALLED to deploy the relevant static files (when
  152. # `python manage.py deploy` is run) and add the necessary middleware.
  153. # Set DEBUG_TOOLBAR_ENABLED to actually enable profiling and the toolbar.
  154. # DEBUG_TOOLBAR_INSTALLED should not impact performance, but
  155. # DEBUG_TOOLBAR_ENABLED will slow down Django.
  156. DEBUG_TOOLBAR_INSTALLED = True
  157. DEBUG_TOOLBAR_ENABLED = False
  158. DEBUG_TOOLBAR_CONFIG = {
  159. 'SHOW_TOOLBAR_CALLBACK': lambda req: DEBUG_TOOLBAR_ENABLED,
  160. 'SHOW_COLLAPSED': False,
  161. }
  162. TEMPLATES = get_setting('TEMPLATES')
  163. TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
  164. # Turn off the template caching
  165. # TEMPLATES[0]['OPTIONS']['loaders'] = [
  166. # 'app_namespace.Loader',
  167. # 'tendenci.apps.theme.template_loaders.Loader',
  168. # 'django.template.loaders.filesystem.Loader',
  169. # 'django.template.loaders.app_directories.Loader',
  170. # ]
  171. # -------------------------------------- #
  172. # LOGGING
  173. # -------------------------------------- #
  174. ENABLE_LOGGING = False
  175. if ENABLE_LOGGING:
  176. if DEBUG:
  177. import sys
  178. if not sys.warnoptions:
  179. # Log Python Warnings to the py.warnings logger instead of the console
  180. import logging
  181. logging.captureWarnings(True)
  182. # Enable ImportWarning and DeprecationWarning messages
  183. import warnings
  184. warnings.simplefilter("default")
  185. LOGGING = {
  186. 'version': 1,
  187. 'disable_existing_loggers': False,
  188. 'root': {
  189. # Set the default logger level to DEBUG so that all messages are passed
  190. # to the handlers and the handlers can decide which messages to actually
  191. # log.
  192. 'level': 'DEBUG',
  193. 'handlers': ['file', 'debug_file', 'mail_admins'],
  194. },
  195. 'loggers': {
  196. # The 'django' logger must be defined to override the defaults
  197. # configured by Django:
  198. # https://github.com/django/django/blob/master/django/utils/log.py
  199. 'django': {
  200. 'level': 'DEBUG',
  201. # Disable the default handlers
  202. 'handlers': [],
  203. # And use the 'root' handlers above instead
  204. 'propagate': True,
  205. },
  206. # In Django <=1.10, 'django.request', 'django.security', and
  207. # 'py.warnings' must also be defined to override the defaults configured
  208. # by Django.
  209. 'django.request': {
  210. 'level': 'DEBUG',
  211. 'handlers': [],
  212. 'propagate': True,
  213. },
  214. 'django.security': {
  215. 'level': 'DEBUG',
  216. 'handlers': [],
  217. 'propagate': True,
  218. },
  219. 'py.warnings': {
  220. 'level': 'DEBUG',
  221. 'handlers': [],
  222. 'propagate': True,
  223. },
  224. # django.db.backends logs all SQL statements at DEBUG level when
  225. # settings.DEBUG is True. That produces lots of log messages, so set
  226. # the level at INFO to filter them.
  227. 'django.db.backends': {
  228. 'level': 'INFO',
  229. },
  230. # The Daphne web server logs connection details at DEBUG level. That
  231. # produces lots of log messages, so set the level at INFO to filter
  232. # them when running under Daphne.
  233. # In addition, Daphne logs ERRORs when workers are stopped/started. It
  234. # is probably unnecessary to send emails for those, so disable the
  235. # mail_admins handler for Daphne logs.
  236. 'daphne': {
  237. 'level': 'INFO',
  238. 'handlers': ['file', 'debug_file'],
  239. 'propagate': False,
  240. },
  241. },
  242. 'filters': {
  243. 'require_debug_true': {
  244. '()': 'django.utils.log.RequireDebugTrue',
  245. },
  246. 'require_debug_false': {
  247. '()': 'django.utils.log.RequireDebugFalse',
  248. },
  249. },
  250. 'formatters': {
  251. 'info': {
  252. 'format': 'TIME="%(asctime)s" LEVEL=%(levelname)s PID=%(process)d LOGGER="%(name)s" MSG="%(message)s"'
  253. },
  254. 'debug': {
  255. 'format': 'TIME="%(asctime)s" LEVEL=%(levelname)s PID=%(process)d LOGGER="%(name)s" FILE="%(pathname)s" LINE=%(lineno)s FUNC="%(funcName)s" MSG="%(message)s"'
  256. },
  257. },
  258. 'handlers': {
  259. # FileHandler is thread safe but not multi-process safe, so log output could be interleaved
  260. # if multiple worker processes generate a log message at the same time. Since Django and
  261. # Tendenci logging is minimal and mostly non-critical, this is not likely to be much of a
  262. # problem in most cases. However, if you need multi-process safe logging, use SysLogHandler
  263. # or SocketHandler with a log server such as https://pypi.python.org/pypi/multilog .
  264. #
  265. # DO NOT use RotatingFileHandler or TimedRotatingFileHandler here, as their rotation
  266. # behavior is not multi-process safe and will cause data to be lost from rotated log files.
  267. # When using those Handlers, each process will redundantly rotate the files and will
  268. # overwrite any files previously rotated by another process. If you need logs to be
  269. # automatically rotated, either use logrotate (and restart Tendenci after rotation), or use
  270. # SocketHandler with a log server such as multilog which can then safely use
  271. # RotatingFileHandler or TimedRotatingFileHandler.
  272. 'file': {
  273. 'level': 'INFO',
  274. 'formatter': 'info',
  275. 'class': 'logging.FileHandler',
  276. 'filename': '/var/log/tendenci/app.log',
  277. },
  278. 'debug_file': {
  279. 'filters': ['require_debug_true'],
  280. 'level': 'DEBUG',
  281. 'formatter': 'debug',
  282. 'class': 'logging.FileHandler',
  283. 'filename': '/var/log/tendenci/debug.log',
  284. },
  285. 'mail_admins': {
  286. 'level': 'ERROR',
  287. 'class': 'tendenci.apps.base.log.CustomAdminEmailHandler',
  288. },
  289. 'discard': {
  290. 'level': 'CRITICAL',
  291. 'class': 'logging.NullHandler',
  292. },
  293. },
  294. }
  295. ATTENDANCE_EVENT_TYPES = ['monthly-meetings']
  296.