Bez popisu
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.

controllers.py 754B

1234567891011121314151617181920212223242526
  1. # -*- coding: utf-8 -*-
  2. import os.path
  3. from werkzeug.wrappers import Response
  4. from .template.loader import TemplateLoader
  5. # This module contains the web UI controllers that will be called from the web ui class
  6. def get_response(tpl, mimetype = 'text/html', status_code = 200):
  7. loader = TemplateLoader()
  8. response = Response( loader.render_to_response(tpl),
  9. mimetype = 'text/html')
  10. response.status_code = status_code
  11. return response
  12. def admin(request):
  13. return get_response('admin/admin.html')
  14. def index(request):
  15. return get_response('index/index.html')
  16. def not_found(request):
  17. return get_response('errors/404.html', status_code = 404)
  18. def test(request):
  19. return get_response('test.html')