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