音乐推荐系统web简单页面

实践:1、pyweb(基本的demo)

代码:main_pg.py:

#coding=utf-8
import web
import sys
import redis
import json
import math

urls = (
    '/', 'index',
    '/test', 'test',
)

render = web.template.render('templates/')
web.template.Template.globals['render'] = render

config = web.storage(
            static = '/static',
            resource = '/resource'
            )
web.template.Template.globals['config'] = config

app = web.application(urls, globals())

class test:
    def GET(self):
        ret = '111'

        return ret


test_dict = {'aaa':'111', 'bbb':'222'}
test2_dict = {'aaa':'444', 'bbb':'555'}


class index:
    def GET(self):
        print "111111111"
        return render.index_badou('null', 'null', '100', '')


    def POST(self):
        param = web.input()
        print "==============="
        item_id= param['item_id']
        print item_id
        if item_id not in test_dict:
            return json.dumps({'block_one':'null', 'block_two'

你可能感兴趣的:(推荐系统从入门到深入,大数据生态圈)