python文件

def nginx_update(request):
    all_server = NginxEThistory.objects.all()
    paginator = Paginator(all_server,20)

    try:
        page = int(request.GET.get('page','1'))
    except ValueError:
        page = 1

    try:
        all_server = paginator.page(page)
    except :
        all_server = paginator.page(paginator.num_pages)
    return render_to_response('nginx_history.html',
                      {'all_host_list': all_server, 'page': page, 'paginator':paginator},context_instance=RequestContext(request))

html文件

{% extends "index.html" %}
{% block title %}OMS{% endblock %}
{% block css %}


{% endblock %}
{% block content %}
      
            
                 
                      
                           {% if all_host_list %}
                           
                               
                                   
                                      ID
                                      文件名
                                      回显
                                   
                               
                               
                               {% for all_host in all_host_list %}
                                   
                                      {{ forloop.counter }}
                                      {{ all_host.filename }}
                                      {{ all_host.message }}
                                      编辑
                                           回显展示
                                   
                               {% endfor %}
                               
                            
                           {% endif %}