default.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # -*- coding: utf-8 -*-
  2. """
  3. flaskbb.configs.default
  4. ~~~~~~~~~~~~~~~~~~~~~~~
  5. This is the default configuration for FlaskBB that every site should have.
  6. You can override these configuration variables in another class.
  7. :copyright: (c) 2013 by the FlaskBB Team.
  8. :license: BSD, see LICENSE for more details.
  9. """
  10. import os
  11. class DefaultConfig(object):
  12. # Get the app root path
  13. # <_basedir>
  14. # ../../ --> flaskbb/flaskbb/configs/base.py
  15. _basedir = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(
  16. os.path.dirname(__file__)))))
  17. PROJECT = "flaskbb"
  18. DEBUG = False
  19. TESTING = False
  20. # Logs
  21. # If SEND_LOGS is set to True, the admins (see the mail configuration) will
  22. # recieve the error logs per email.
  23. SEND_LOGS = False
  24. # The filename for the info and error logs. The logfiles are stored at
  25. # flaskbb/logs
  26. INFO_LOG = "info.log"
  27. ERROR_LOG = "error.log"
  28. # Default Database
  29. SQLALCHEMY_DATABASE_URI = 'sqlite:///' + _basedir + '/' + \
  30. PROJECT + ".sqlite"
  31. # sqlite for testing/debug.
  32. SQLALCHEMY_ECHO = False
  33. # Security
  34. # This is the secret key that is used for session signing.
  35. # You can generate a secure key with os.urandom(24)
  36. SECRET_KEY = 'secret key'
  37. # Protection against form post fraud
  38. WTF_CSRF_ENABLED = True
  39. WTF_CSRF_SECRET_KEY = "reallyhardtoguess"
  40. # Auth
  41. LOGIN_VIEW = "auth.login"
  42. REAUTH_VIEW = "auth.reauth"
  43. LOGIN_MESSAGE_CATEGORY = "error"
  44. # Caching
  45. CACHE_TYPE = "simple"
  46. CACHE_DEFAULT_TIMEOUT = 60
  47. ## Captcha
  48. RECAPTCHA_ENABLE = False
  49. RECAPTCHA_USE_SSL = False
  50. RECAPTCHA_PUBLIC_KEY = "your_public_recaptcha_key"
  51. RECAPTCHA_PRIVATE_KEY = "your_private_recaptcha_key"
  52. RECAPTCHA_OPTIONS = {"theme": "white"}
  53. ## Mail
  54. MAIL_SERVER = "localhost"
  55. MAIL_PORT = 25
  56. MAIL_USE_SSL = False
  57. MAIL_USE_TLS = False
  58. MAIL_USERNAME = "noreply@example.org"
  59. MAIL_PASSWORD = ""
  60. MAIL_DEFAULT_SENDER = ("Default Sender", "noreply@example.org")
  61. ADMINS = ["admin@example.org"]
  62. ## App specific configs
  63. # Pagination
  64. # How many posts per page are displayed
  65. POSTS_PER_PAGE = 10
  66. # How many topics per page are displayed
  67. TOPICS_PER_PAGE = 10
  68. # How many users per page are displayed.
  69. # This affects mainly the memberlist
  70. USERS_PER_PAGE = 10
  71. # How long the use can be inactive before he is marked as offline
  72. ONLINE_LAST_MINUTES = 15
  73. # The length of the topic title in characters on the index
  74. TITLE_LENGTH = 15
  75. # This is really handy if you do not have an redis instance like on windows
  76. USE_REDIS = True
  77. REDIS_HOST = 'localhost'
  78. REDIS_PORT = 6379
  79. REDIS_DB = 0
  80. # The days for how long the forum should deal with unread topics
  81. # 0 - Disable it
  82. TRACKER_LENGTH = 0