Django micro-framework, web.py:
from django.conf import settings
from django.conf.urls import patterns
if not settings.configured:
settings.configure(
DEBUG=True,
ROOT_URLCONF='web',
TEMPLATE_DIRS=['.'],
)
urlpatterns = patterns('',
(r'^$', 'web.index'),
(r'^show_data/$', 'web.show_data'),
)
from django.shortcuts import render
def index(request):
return render(request, 'index.html', {})
def show_data(request):
from pay import get_data
return render(request, 'show_data.html', {'data': get_data()})
if __name__ == '__main__':
from django.core.management import execute_from_command_line
execute_from_command_line()