config.py 509 B

1234567891011121314151617181920212223242526
  1. import os
  2. import sys
  3. import flask
  4. import itsdangerous
  5. import playhouse.sqlite_ext
  6. DB = playhouse.sqlite_ext.SqliteExtDatabase(None)
  7. PER_PAGE = 50
  8. SERIALIZER = itsdangerous.URLSafeSerializer("TEMP KEY")
  9. app = flask.Flask(__name__)
  10. app.secret_key = "ARGLBARGL"
  11. if sys.stderr.isatty():
  12. def log(msg):
  13. sys.stderr.write(str(msg))
  14. sys.stderr.write("\n")
  15. else:
  16. def log(msg):
  17. sys.stderr.write("\x1b[31m")
  18. sys.stderr.write(str(msg))
  19. sys.stderr.write("\x1b[39m\n")