La version 5 de Planète Casio. Regroupe le forum, les programmes, les tutoriel, les sprites et tous les autres outils développés par nos soins.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

73 lines
2.2 KiB

  1. import os
  2. import datetime
  3. try:
  4. from local_config import LocalConfig
  5. except ImportError:
  6. print(" \033[92mWARNING: Local config not found\033[0m")
  7. class LocalConfig():
  8. pass
  9. class Config(object):
  10. SECRET_KEY = os.environ.get('SECRET_KEY') or LocalConfig.SECRET_KEY
  11. SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
  12. 'postgresql+psycopg2://' + os.environ.get('USER') + ':@/' \
  13. + LocalConfig.DB_NAME
  14. SQLALCHEMY_TRACK_MODIFICATIONS = False
  15. MAIL_DEFAULT_SENDER = "noreply@v5.planet-casio.com"
  16. MAIL_SUPPRESS_SEND = None
  17. class DefaultConfig(object):
  18. """Every value here can be overrided in the local_config.py class"""
  19. # Domain
  20. DOMAIN = "v5.planet-casio.com"
  21. # Length allocated to privilege names (slugs)
  22. PRIVS_MAXLEN = 64
  23. # Forbidden user names
  24. FORBIDDEN_USERNAMES = ["admin", "root", "webmaster", "contact"]
  25. # Unauthorized message (@priv_required)
  26. UNAUTHORIZED_MSG = "Vous n'avez pas l'autorisation d'effectuer cette action !"
  27. # Minimum and maximum user name length
  28. USER_NAME_MINLEN = 3
  29. USER_NAME_MAXLEN = 32
  30. # Minimum password length for new users and new passwords
  31. PASSWORD_MINLEN = 10
  32. # Maximum thread name length
  33. THREAD_NAME_MAXLEN = 32
  34. # Amount of comments per thread page
  35. COMMENTS_PER_PAGE = 20
  36. # Remember-me cookie duration time
  37. REMEMBER_COOKIE_DURATION = datetime.timedelta(days=7)
  38. # XP points for content posting (and deletion)
  39. XP_POINTS = {
  40. 'topic': 2,
  41. 'program': 5,
  42. 'tutorial': 5,
  43. 'comment': 1,
  44. 'contest': 10,
  45. }
  46. # Database name
  47. DB_NAME = "pcv5"
  48. # LDAP usage
  49. USE_LDAP = False
  50. # LDAP configuration
  51. LDAP_PASSWORD = "openldap"
  52. LDAP_ORGANIZATION = "o=planet-casio"
  53. # Secret key used to authenticate tokens. **USE YOURS!**
  54. SECRET_KEY = "a-random-secret-key"
  55. # Avatars folder
  56. AVATARS_FOLDER = '/avatar/folder/'
  57. # Enable guest post
  58. ENABLE_GUEST_POST = True
  59. # Disable email confimation
  60. ENABLE_EMAIL_CONFIRMATION = True
  61. # Send emails
  62. SEND_MAILS = True
  63. class V5Config(LocalConfig, DefaultConfig):
  64. # Values put here cannot be overidden with local_config
  65. pass