config.py 1.7 KB

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