/ccnyevent/settings.py

https://bitbucket.org/davi0589/ccny_events · Python · 279 lines · 178 code · 53 blank · 48 comment · 2 complexity · 2f529fc4f96c8a28deb73a50be6d9cad MD5 · raw file

  1. # -*- coding: utf-8 -*-
  2. # Django settings for social pinax project.
  3. import os.path
  4. import posixpath
  5. import pinax
  6. PINAX_ROOT = os.path.abspath(os.path.dirname(pinax.__file__))
  7. PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
  8. # tells Pinax to use the default theme
  9. PINAX_THEME = 'default'
  10. DEBUG = True
  11. TEMPLATE_DEBUG = DEBUG
  12. # tells Pinax to serve media through django.views.static.serve.
  13. SERVE_MEDIA = DEBUG
  14. ADMINS = (
  15. ('dreadi', 'ccnyevents@gmail.com'),
  16. )
  17. MANAGERS = ADMINS
  18. DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresq$
  19. DATABASE_NAME = 'dreadi_' # Or path to database file if using sqlite3.
  20. DATABASE_USER = 'dreadi_' # Not used with sqlite3.
  21. DATABASE_PASSWORD = 'ccnyevents' # Not used with sqlite3.
  22. #EMAIL_HOST='smtp5.webfaction.com'
  23. #EMAIL_HOST_USER='dreadi'
  24. #EMAIL_HOST_PASSWORD='ccnyevents'
  25. #EMAIL_PORT='25'
  26. #DEFAULT_FROM_EMAIL = 'ccnyevents@dreadi.webfactional.com'
  27. #SERVER_EMAIL ='ccnyevents@dreadi.webfactional.com'
  28. #CONTACT_EMAIL = "ccnyevents@gmail.com"
  29. EMAIL_HOST = 'smtp.gmail.com'
  30. EMAIL_PORT = '25'
  31. EMAIL_HOST_PASSWORD = 'ccnyevent'
  32. EMAIL_HOST_USER = 'ccnyevents@gmail.com'
  33. EMAIL_USE_TLS = True
  34. # Local time zone for this installation. Choices can be found here:
  35. # http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
  36. # although not all variations may be possible on all operating systems.
  37. # If running in a Windows environment this must be set to the same as your
  38. # system time zone.
  39. TIME_ZONE = 'US/Eastern'
  40. # Language code for this installation. All choices can be found here:
  41. # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
  42. # http://blogs.law.harvard.edu/tech/stories/storyReader$15
  43. LANGUAGE_CODE = 'en'
  44. SITE_ID = 1
  45. # If you set this to False, Django will make some optimizations so as not
  46. # to load the internationalization machinery.
  47. USE_I18N = False
  48. # Absolute path to the directory that holds media.
  49. # Example: "/home/media/media.lawrence.com/"
  50. MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'site_media', 'media')
  51. # URL that handles the media served from MEDIA_ROOT.
  52. # Example: "http://media.lawrence.com"
  53. MEDIA_URL = '/site_media/media/'
  54. # Absolute path to the directory that holds static files like app media.
  55. # Example: "/home/media/media.lawrence.com/apps/"
  56. STATIC_ROOT = os.path.join(PROJECT_ROOT, 'site_media', 'static')
  57. # URL that handles the static files like app media.
  58. # Example: "http://media.lawrence.com"
  59. STATIC_URL = '/site_media/static/'
  60. # Additional directories which hold static files
  61. STATICFILES_DIRS = (
  62. ('ccnyevents', os.path.join(PROJECT_ROOT, 'media')),
  63. ('pinax', os.path.join(PINAX_ROOT, 'media', PINAX_THEME)),
  64. )
  65. # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
  66. # trailing slash.
  67. # Examples: "http://foo.com/media/", "/media/".
  68. ADMIN_MEDIA_PREFIX = posixpath.join(STATIC_URL, "admin/")
  69. # Make this unique, and don't share it with anybody.
  70. SECRET_KEY = '@9dn*flz&6tyks*_e18+%%d!yu4^fkn*sdl)1i+agu$!@kahdg'
  71. # List of callables that know how to import templates from various sources.
  72. TEMPLATE_LOADERS = (
  73. 'django.template.loaders.filesystem.load_template_source',
  74. 'django.template.loaders.app_directories.load_template_source',
  75. )
  76. MIDDLEWARE_CLASSES = (
  77. 'django.middleware.common.CommonMiddleware',
  78. 'django.contrib.sessions.middleware.SessionMiddleware',
  79. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  80. 'django_openid.consumer.SessionConsumer',
  81. 'account.middleware.LocaleMiddleware',
  82. 'django.middleware.doc.XViewMiddleware',
  83. 'pagination.middleware.PaginationMiddleware',
  84. 'django_sorting.middleware.SortingMiddleware',
  85. 'djangodblog.middleware.DBLogMiddleware',
  86. 'pinax.middleware.security.HideSensistiveFieldsMiddleware',
  87. 'django.middleware.transaction.TransactionMiddleware',
  88. )
  89. ROOT_URLCONF = 'ccnyevents.urls'
  90. TEMPLATE_DIRS = (
  91. os.path.join(PROJECT_ROOT, "templates"),
  92. os.path.join(PINAX_ROOT, "templates", PINAX_THEME),
  93. )
  94. TEMPLATE_CONTEXT_PROCESSORS = (
  95. "django.core.context_processors.auth",
  96. "django.core.context_processors.debug",
  97. "django.core.context_processors.i18n",
  98. "django.core.context_processors.media",
  99. "django.core.context_processors.request",
  100. "pinax.core.context_processors.pinax_settings",
  101. "notification.context_processors.notification",
  102. "announcements.context_processors.site_wide_announcements",
  103. "account.context_processors.openid",
  104. "account.context_processors.account",
  105. "messages.context_processors.inbox",
  106. "friends_app.context_processors.invitations",
  107. "ccnyevents.context_processors.combined_inbox_count",
  108. )
  109. COMBINED_INBOX_COUNT_SOURCES = (
  110. "messages.context_processors.inbox",
  111. "friends_app.context_processors.invitations",
  112. "notification.context_processors.notification",
  113. )
  114. INSTALLED_APPS = (
  115. # included
  116. 'django.contrib.auth',
  117. 'django.contrib.contenttypes',
  118. 'django.contrib.sessions',
  119. 'django.contrib.sites',
  120. 'django.contrib.humanize',
  121. 'django.contrib.markup',
  122. 'pinax.templatetags',
  123. # external
  124. 'notification', # must be first
  125. 'django_openid',
  126. 'emailconfirmation',
  127. 'django_extensions',
  128. 'robots',
  129. 'friends',
  130. 'mailer',
  131. 'messages',
  132. 'announcements',
  133. 'oembed',
  134. 'djangodblog',
  135. 'pagination',
  136. # 'gravatar',
  137. 'threadedcomments',
  138. 'threadedcomments_extras',
  139. 'wiki',
  140. 'swaps',
  141. 'timezones',
  142. 'voting',
  143. 'voting_extras',
  144. 'tagging',
  145. 'bookmarks',
  146. 'blog',
  147. 'ajax_validation',
  148. 'photologue',
  149. 'avatar',
  150. 'flag',
  151. 'microblogging',
  152. 'locations',
  153. 'uni_form',
  154. 'django_sorting',
  155. 'django_markup',
  156. 'staticfiles',
  157. # internal (for now)
  158. 'analytics',
  159. 'profiles',
  160. 'account',
  161. 'signup_codes',
  162. 'tribes',
  163. 'photos',
  164. 'tag_app',
  165. 'topics',
  166. 'groups',
  167. 'django.contrib.admin',
  168. )
  169. ABSOLUTE_URL_OVERRIDES = {
  170. "auth.user": lambda o: "/profiles/profile/%s/" % o.username,
  171. }
  172. MARKUP_FILTER_FALLBACK = 'none'
  173. MARKUP_CHOICES = (
  174. ('restructuredtext', u'reStructuredText'),
  175. ('textile', u'Textile'),
  176. ('markdown', u'Markdown'),
  177. ('creole', u'Creole'),
  178. )
  179. WIKI_MARKUP_CHOICES = MARKUP_CHOICES
  180. AUTH_PROFILE_MODULE = 'profiles.Profile'
  181. NOTIFICATION_LANGUAGE_MODULE = 'account.Account'
  182. ACCOUNT_OPEN_SIGNUP = True
  183. ACCOUNT_REQUIRED_EMAIL = True
  184. ACCOUNT_EMAIL_VERIFICATION = True
  185. EMAIL_CONFIRMATION_DAYS = 2
  186. EMAIL_DEBUG = DEBUG
  187. CONTACT_EMAIL = "ccnyevents@gmail.com"
  188. SITE_NAME = "CCNY EVENTS"
  189. LOGIN_URL = "/account/login/"
  190. LOGIN_REDIRECT_URLNAME = "home"
  191. INTERNAL_IPS = (
  192. '127.0.0.1',
  193. )
  194. ugettext = lambda s: s
  195. LANGUAGES = (
  196. ('en', u'English'),
  197. )
  198. # URCHIN_ID = "ua-..."
  199. YAHOO_MAPS_API_KEY = "..."
  200. class NullStream(object):
  201. def write(*args, **kwargs):
  202. pass
  203. writeline = write
  204. writelines = write
  205. RESTRUCTUREDTEXT_FILTER_SETTINGS = {
  206. 'cloak_email_addresses': True,
  207. 'file_insertion_enabled': False,
  208. 'raw_enabled': False,
  209. 'warning_stream': NullStream(),
  210. 'strip_comments': True,
  211. }
  212. # if Django is running behind a proxy, we need to do things like use
  213. # HTTP_X_FORWARDED_FOR instead of REMOTE_ADDR. This setting is used
  214. # to inform apps of this fact
  215. BEHIND_PROXY = False
  216. FORCE_LOWERCASE_TAGS = True
  217. WIKI_REQUIRES_LOGIN = True
  218. # Uncomment this line after signing up for a Yahoo Maps API key at the
  219. # following URL: https://developer.yahoo.com/wsregapp/
  220. # YAHOO_MAPS_API_KEY = ''
  221. # local_settings.py can be used to override environment-specific settings
  222. # like database and email that differ between development and production.
  223. try:
  224. from local_settings import *
  225. except ImportError:
  226. pass