Ejemplo n.º 1
0
def index(request):
    # prepare for channel id
    cid = create_channel('omchat')

    # prepare for list of chats
    chat_list = Chat.objects.order_by('-pub_time')[:20]

    return render_to_response('omchat/index.html', {
            'cid': cid,
            'init_data': dump_rc(ChatRc, chat_list),
            'closure_compiled': True,
            'user_ip': request.META['REMOTE_ADDR']
        }, context_instance=RequestContext(request)
    )
Ejemplo n.º 2
0
def getcid(request):
    cleanup_channel('omchat')
    return json_resp({
        'cid': create_channel('omchat'),
        'nfds': len(get_appchannel('omchat'))
    })