default.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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) 2014 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. DEBUG = False
  18. TESTING = False
  19. # Logs
  20. # If SEND_LOGS is set to True, the admins (see the mail configuration) will
  21. # recieve the error logs per email.
  22. SEND_LOGS = False
  23. # The filename for the info and error logs. The logfiles are stored at
  24. # flaskbb/logs
  25. INFO_LOG = "info.log"
  26. ERROR_LOG = "error.log"
  27. # Default Database
  28. SQLALCHEMY_DATABASE_URI = 'sqlite:///' + _basedir + '/' + \
  29. 'flaskbb.sqlite'
  30. # sqlite for testing/debug.
  31. SQLALCHEMY_ECHO = False
  32. # Security
  33. # This is the secret key that is used for session signing.
  34. # You can generate a secure key with os.urandom(24)
  35. SECRET_KEY = 'secret key'
  36. # Protection against form post fraud
  37. WTF_CSRF_ENABLED = True
  38. WTF_CSRF_SECRET_KEY = "reallyhardtoguess"
  39. # Auth
  40. LOGIN_VIEW = "auth.login"
  41. REAUTH_VIEW = "auth.reauth"
  42. LOGIN_MESSAGE_CATEGORY = "error"
  43. # Caching
  44. CACHE_TYPE = "simple"
  45. CACHE_DEFAULT_TIMEOUT = 60
  46. ## Captcha
  47. RECAPTCHA_ENABLED = False
  48. RECAPTCHA_USE_SSL = False
  49. RECAPTCHA_PUBLIC_KEY = "your_public_recaptcha_key"
  50. RECAPTCHA_PRIVATE_KEY = "your_private_recaptcha_key"
  51. RECAPTCHA_OPTIONS = {"theme": "white"}
  52. ## Mail
  53. MAIL_SERVER = "localhost"
  54. MAIL_PORT = 25
  55. MAIL_USE_SSL = False
  56. MAIL_USE_TLS = False
  57. MAIL_USERNAME = "noreply@example.org"
  58. MAIL_PASSWORD = ""
  59. MAIL_DEFAULT_SENDER = ("Default Sender", "noreply@example.org")
  60. # Where to logger should send the emails to
  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. REDIS_ENABLED = False
  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 = 7
  83. FORUM_URL_PREFIX = ""
  84. USER_URL_PREFIX = "/user"
  85. AUTH_URL_PREFIX = "/auth"
  86. ADMIN_URL_PREFIX = "/admin"
  87. # Default style
  88. DEFAULT_THEME = "bootstrap3"
  89. # Your project name with a subtitle
  90. PROJECT_TITLE = "FlaskBB"
  91. PROJECT_SUBTITLE = "A lightweight forum software in flask"