default.py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. import sys
  12. import datetime
  13. _VERSION_STR = '{0.major}{0.minor}'.format(sys.version_info)
  14. class DefaultConfig(object):
  15. # Get the app root path
  16. # <_basedir>
  17. # ../../ --> flaskbb/flaskbb/configs/base.py
  18. _basedir = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(
  19. os.path.dirname(__file__)))))
  20. DEBUG = False
  21. TESTING = False
  22. # Logs
  23. # If SEND_LOGS is set to True, the admins (see the mail configuration) will
  24. # recieve the error logs per email.
  25. SEND_LOGS = False
  26. # The filename for the info and error logs. The logfiles are stored at
  27. # flaskbb/logs
  28. INFO_LOG = "info.log"
  29. ERROR_LOG = "error.log"
  30. # Default Database
  31. SQLALCHEMY_DATABASE_URI = 'sqlite:///' + _basedir + '/' + \
  32. 'flaskbb.sqlite'
  33. # This option will be removed as soon as Flask-SQLAlchemy removes it.
  34. # At the moment it is just used to suppress the super annoying warning
  35. SQLALCHEMY_TRACK_MODIFICATIONS = False
  36. # This will print all SQL statements
  37. SQLALCHEMY_ECHO = False
  38. # Security
  39. # This is the secret key that is used for session signing.
  40. # You can generate a secure key with os.urandom(24)
  41. SECRET_KEY = 'secret key'
  42. # Protection against form post fraud
  43. WTF_CSRF_ENABLED = True
  44. WTF_CSRF_SECRET_KEY = "reallyhardtoguess"
  45. # Searching
  46. WHOOSH_BASE = os.path.join(_basedir, "whoosh_index", _VERSION_STR)
  47. # Auth
  48. LOGIN_VIEW = "auth.login"
  49. REAUTH_VIEW = "auth.reauth"
  50. LOGIN_MESSAGE_CATEGORY = "info"
  51. REFRESH_MESSAGE_CATEGORY = "info"
  52. # The name of the cookie to store the “remember me” information in.
  53. # Default: remember_token
  54. #REMEMBER_COOKIE_NAME = "remember_token"
  55. # The amount of time before the cookie expires, as a datetime.timedelta object.
  56. # Default: 365 days (1 non-leap Gregorian year)
  57. #REMEMBER_COOKIE_DURATION = datetime.timedelta(days=365)
  58. # If the “Remember Me” cookie should cross domains,
  59. # set the domain value here (i.e. .example.com would allow the cookie
  60. # to be used on all subdomains of example.com).
  61. # Default: None
  62. #REMEMBER_COOKIE_DOMAIN = None
  63. # Limits the “Remember Me” cookie to a certain path.
  64. # Default: /
  65. #REMEMBER_COOKIE_PATH = "/"
  66. # Restricts the “Remember Me” cookie’s scope to secure channels (typically HTTPS).
  67. # Default: None
  68. #REMEMBER_COOKIE_SECURE = None
  69. # Prevents the “Remember Me” cookie from being accessed by client-side scripts.
  70. # Default: False
  71. #REMEMBER_COOKIE_HTTPONLY = False
  72. # Caching
  73. CACHE_TYPE = "simple"
  74. CACHE_DEFAULT_TIMEOUT = 60
  75. ## Captcha
  76. RECAPTCHA_ENABLED = False
  77. RECAPTCHA_USE_SSL = False
  78. RECAPTCHA_PUBLIC_KEY = "your_public_recaptcha_key"
  79. RECAPTCHA_PRIVATE_KEY = "your_private_recaptcha_key"
  80. RECAPTCHA_OPTIONS = {"theme": "white"}
  81. ## Mail
  82. MAIL_SERVER = "localhost"
  83. MAIL_PORT = 25
  84. MAIL_USE_SSL = False
  85. MAIL_USE_TLS = False
  86. MAIL_USERNAME = "noreply@example.org"
  87. MAIL_PASSWORD = ""
  88. MAIL_DEFAULT_SENDER = ("Default Sender", "noreply@example.org")
  89. # Where to logger should send the emails to
  90. ADMINS = ["admin@example.org"]
  91. # Flask-Redis
  92. REDIS_ENABLED = False
  93. REDIS_URL = "redis://:password@localhost:6379"
  94. REDIS_DATABASE = 0
  95. # URL Prefixes
  96. FORUM_URL_PREFIX = ""
  97. USER_URL_PREFIX = "/user"
  98. MESSAGE_URL_PREFIX = "/message"
  99. AUTH_URL_PREFIX = "/auth"
  100. ADMIN_URL_PREFIX = "/admin"