A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
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.
 
 
 
 
 

38 lines
970 B

  1. #! /data/project/copyvios/env/bin/python
  2. # -*- coding: utf-8 -*-
  3. from time import asctime
  4. from logging import DEBUG, TimedRotatingFileHandler
  5. from flask import Flask, request
  6. from flask.ext.mako import render_template
  7. from flup.server.fcgi import WSGIServer
  8. app = Flask(__name__)
  9. app.logger.setLevel(DEBUG)
  10. app.logger.addHandler(TimedRotatingFileHandler("logs/app.log", when="D",
  11. interval=1, backupCount=7))
  12. app.logger.info(u"Flask server started " + asctime())
  13. @app.after_request
  14. def write_access_log(response):
  15. msg = u"%s %s -> %s"
  16. app.logger.debug(msg, asctime(), request.path, response.status_code)
  17. return response
  18. @app.route("/")
  19. def index():
  20. return render_template("index.mako")
  21. @app.route("/settings")
  22. def settings():
  23. return render_template("settings.mako")
  24. @app.route("/debug")
  25. def debug():
  26. return render_template("debug.mako")
  27. if __name__ == '__main__':
  28. WSGIServer(app).run()