先贴出我要做网页的代码:(views.py)
from django.shortcuts import render,render_to_response from django.http import HttpResponse from django.http import request,HttpResponseRedirect from django.template.loader import get_template from django.template import RequestContext from form import models,forms # Create your views here. def index(request,pid = None,del_pass=None): if 'username' in request.COOKIES and 'usercolor' in request.COOKIES: username = request.COOKIES['username'] usercolor = request.COOKIES['usercolor'] template = get_template('index.html') html = template.render(locals()) return HttpResponse(html) def login(request): message = '请登录!'