懒惰

我的懒惰似乎已经无法抵挡了,直到——站点被无缘无故的删除了。

所幸数据库还都在,所以今天下午也就做了一些恢复工作。

一些细节上的问题慢慢来吧。当务之急是找到一个很好的图床来存图片——因为服务器这么一抽风,图片都没了根本没的找阿!

在这里谴责一下 bluehost

你们应该做好备份的。。。

you should have backuped everything!
===说说这几天===

开始跟着一本很好很好的教材学 Django 哈哈 我自己都想笑,因为 python 还不会呢。
但是跟着流行写代码,并且顺利执行出来,还是很愉快的。

其实的 views.py 是这样的:

from django.http import HttpResponse, Http404
from django.contrib.auth.models import User
from django.template import Context
from django.template.loader import get_template
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.contrib.auth import logout
from django.template import RequestContext

def main_page(request):
	return render_to_response(
		'main_page.html', RequestContext(request)
		)

def user_page(request, username):
	try:
		user = User.objects.get(username=username)
	except:
		raise Http404('Reqested user not found.')
	bookmarks = user.bookmark_set.all()
	variables = RequestContext(request, {
		'username':username,
		'bookmarks':bookmarks
		})
	return render_to_response('user_page.html', variables)
def logout_page(request):
	logout(request)
	return HttpResponseRedirect('/')

别问我为什么。。我不知道……哪天研究好了我就过来写 阿哈哈

0 Comments

Leave a Reply

Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>