import sys import os import eventlet from eventlet import wsgi def application(environ, start_response): try: status = '200 OK' f = open(r'./template/base.html') output = f.read() f.close() response_headers = [('Content-type', 'html'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] except: status = "500 Error" response_headers = [("content-type", "text/plain")] start_response(status, response_headers, sys.exc_info()) return ["Error"] wsgi.applications = { '': application, '/map': map111, '/test': application }
Я не могу понять как сделать url-ы, т.е. чтобы можно было перейти по различным адресам и при этом генерировались различные страницы. Думаю как-то в wsgi.applications добавить ссылку — вызов функции, генерации страницы.
Как данной действие можно сделать?
Заранее спасибо!