Experimental radio CMS based on Flask (Python) micro-framework for Radio Rhino (Strasbourg).
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.

config.py 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import os
  2. basedir = os.path.abspath(os.path.dirname(__file__))
  3. __APP_NAME__ = "Rhino Radio CMS"
  4. LIQUIDSOAP_TOKEN = os.environ.get('LIQUIDSOAP_TOKEN') or 'hijackmyradio'
  5. AIRTIME_API_KEY = os.environ.get('AIRTIME_API_KEY')
  6. class Config:
  7. SECRET_KEY = os.environ.get('SECRET_KEY') or 'hackme'
  8. @staticmethod
  9. def init_app(app):
  10. pass
  11. class DevelopmentConfig(Config):
  12. DEBUG = True
  13. TEMPLATES_AUTO_RELOAD = True
  14. # EXPLAIN_TEMPLATE_LOADING = True
  15. MAIL_SERVER = 'radiorhino.eu'
  16. MAIL_PORT = 465
  17. MAIL_USE_TLS = True
  18. MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
  19. MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
  20. SQLALCHEMY_TRACK_MODIFICATIONS = False
  21. # SQLite :
  22. #SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or 'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')
  23. # PostgreSQL :
  24. SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or 'postgresql://user:password@localhost/rhino'
  25. class TestingConfig(Config):
  26. TESTING = True
  27. MAIL_SERVER = 'radiorhino.eu'
  28. MAIL_PORT = 465
  29. MAIL_USE_TLS = True
  30. MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
  31. MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
  32. SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or 'postgresql://user:password@localhost/rhino'
  33. SQLALCHEMY_TRACK_MODIFICATIONS = False
  34. class ProductionConfig(Config):
  35. MAIL_SERVER = 'radiorhino.eu'
  36. MAIL_PORT = 465
  37. MAIL_USE_TLS = True
  38. MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
  39. MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
  40. SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or 'postgresql+psycopg2://user:password@localhost/rhino'
  41. SQLALCHEMY_TRACK_MODIFICATIONS = False
  42. config = {
  43. 'development': DevelopmentConfig,
  44. 'testing': TestingConfig,
  45. 'production': ProductionConfig,
  46. 'default': DevelopmentConfig
  47. }