config.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/usr/bin/env python
  2. # -*- coding=UTF-8 -*-
  3. # **************************************************************************
  4. # Copyright © 2016 jianglin
  5. # File Name: production.py
  6. # Author: jianglin
  7. # Email: xiyang0807@gmail.com
  8. # Created: 2016-05-20 12:31:46 (CST)
  9. # Last Update:星期二 2016-7-26 18:3:24 (CST)
  10. # By: jianglin
  11. # Description:
  12. # **************************************************************************
  13. from datetime import timedelta
  14. DEBUG = True
  15. SECRET_KEY = 'secret key'
  16. SECURITY_PASSWORD_SALT = 'you will never guess'
  17. # remember me to save cookies
  18. PERMANENT_SESSION_LIFETIME = timedelta(days=3)
  19. REMEMBER_COOKIE_DURATION = timedelta(days=3)
  20. ONLINE_LAST_MINUTES = 5
  21. # You want show how many topics per page
  22. PER_PAGE = 12
  23. # Use cache
  24. CACHE_TYPE = 'redis'
  25. CACHE_DEFAULT_TIMEOUT = 60
  26. CACHE_KEY_PREFIX = 'cache:'
  27. CACHE_REDIS_HOST = '127.0.0.1'
  28. CACHE_REDIS_PORT = '6379'
  29. CACHE_REDIS_PASSWORD = 'redis password'
  30. CACHE_REDIS_DB = 1
  31. # Mail such as qq
  32. MAIL_SERVER = 'smtp.qq.com'
  33. MAIL_PORT = 25
  34. MAIL_USE_TLS = True
  35. MAIL_USE_SSL = False
  36. MAIL_USERNAME = 'Your domain email'
  37. MAIL_PASSWORD = 'Your password'
  38. MAIL_DEFAULT_SENDER = 'Your domain email'
  39. # Log,if SEND_LOGS is True when web app has some error happen(500)
  40. # the email will be sent to RECEIVER
  41. SEND_LOGS = False
  42. RECEIVER = ["yourname@gmail.com"]
  43. INFO_LOG = "info.log"
  44. ERROR_LOG = "error.log"
  45. # Sql
  46. SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:password@localhost/db_name'
  47. # SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/test.db'
  48. # SQLALCHEMY_DATABASE_URI = 'mysql://username:password@server/db'
  49. # avatar upload folder
  50. AVATAR_FOLDER = 'avatars/'
  51. # Locale
  52. LANGUAGES = {'en': 'English', 'zh': 'Chinese'}