ChinaUnix.net
相关文章推荐:

Django中设置自定义标签或者过滤器路径

1.要实现一个功能数据集里面的作循环然后将其的一个值传到下一个当数据集的条件想了一下只能是考虑使用 自定义标签的办法了! from django import template from django.template import Context, Template, loader, resolve_variable register = template.Library() class PostDetailNode(template.Node): def __init__(self, id, current_post_id): self.id = id self.current_post_id = current_post_id ...

by hkebao - Python文档中心 - 2009-08-24 08:17:44 阅读(2710) 回复(0)

相关讨论

请问一下大家是怎么获取到input file的文件路径的,我通过网页 的post去查询详细的输出,没有找到客户端文件路径的信息, 请问有什么其它的方式可以获取得到吗?谢谢。

by suiyi2599 - Python - 2008-03-24 11:17:52 阅读(2822) 回复(0)

我一直在家里做python,家里机器较差,为P41.70G,256M内存。但在家里时,跑django经常出现莫名其妙的错误,比如登录后显示的是“找不到服务器”,要后退,再登录一次,或者刷新好几次。有些功能不能使用,比如admin下的修改口令等功能均不能用,点击后好长时间是打不开页面的错误。 起初我以为是django自带的baseHttpServer的问题,后来今天把配置文件和程序全拿到公司机器上跑下,一模一样的配置,一样的数据库mysql,结果没一点...

by aoeiu - Python - 2008-02-18 15:30:32 阅读(3905) 回复(8)

1.在python应用日志的功能代码如下: import logging LEVELS = {'debug': logging.DEBUG, 'info': logging.INFO, 'warning': logging.WARNING, 'error': logging.ERROR, 'critical': logging.CRITICAL} level = LEVELS.get('debug',logging.NOTSET) logging.basicConfig(level = level) logging.debug('This is a debug message') 这个只是一个DEBUG级别的日志记录功能。 import loggin...

by hkebao - Python文档中心 - 2009-08-04 09:37:17 阅读(2018) 回复(0)

django如何整合fckeditor

by DeceitLei - Python - 2008-02-09 21:58:50 阅读(3840) 回复(3)

django的new form库很不错,但是,现在遇到一个问题。描述如下: class MyForm(forms.Form): sub_group = forms.ChoiceField(choices = ()) 我现在的问题是,choices的参数需要根据不同的用户来查找,我怎么把我的参数传入? 谢谢!

by guotie - Python - 2007-11-17 08:47:01 阅读(3708) 回复(3)

今天学习了《django Step by Step》第七章,感谢limodou提供初学者如此精彩的入门教程。 文章地址 http://www.woodpecker.org.cn/obp/django/django-stepbystep/newtest/doc/tut07.html 通篇看了第七章,请问作者是否忘了增加介绍编辑address/view.py的部分,因为增加的模版address_list.html在代码没找到使用该模版的地方?(可能是我看代码不仔细) 文章最后的图显示的姓名是7位的,但是文介绍只能输入6位,请问图片是否有...

by sunable - Python - 2006-11-20 09:11:05 阅读(2057) 回复(2)

在项目用到验证码,懒得去找,自己随便写了一个: views.py: def get_check_code_image(request,image='media/images/checkcode.gif'): import Image, ImageDraw, ImageFont, random im = Image.open(image) draw = ImageDraw.Draw(im) mp = md5.new() mp_src = mp.update(str(datetime.now())) mp_src = mp.hexdigest() rand_str = mp_src[0:4] draw.text...

by hkebao - Python文档中心 - 2009-08-14 16:47:44 阅读(2376) 回复(0)

http://www.woodpecker.org.cn/obp/django/django-faq/templates.html 讲django模板比较详细 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/84280/showart_2016460.html

by hkebao - Python文档中心 - 2009-08-03 16:38:21 阅读(1346) 回复(0)

看到啄木鸟上面一篇关于django自带的用户认证系统的介绍,学习了一下 文章地址:http://wiki.woodpecker.org.cn/moin/djangoAuth-ZH manage.py syncdb后创建超级用户那些没问题,认证系统装好了 然后我 from django.contrib.auth.models import User 时出问题了: Traceback (most recent call last): File "", line 1, in File "D:\Python25\Lib\site-packages\django\contrib\auth\models.py", line 3...

by thsniperwolf - Python - 2009-07-01 12:23:13 阅读(1934) 回复(3)

5.拷贝FCKEditor目录下的 fckeditor.py 到 util目录下.查找 IsCompatible 方法定义.修改如下 def IsCompatible(self): if self.sAgent: sAgent = self.sAgent elif (os.environ.has_key("HTTP_USER_AGENT")): sAgent = os.environ.get("HTTP_USER_AGENT", "") else: sAgent = "" if (sAgent.find("MSIE") >= 0) and (sAgent.find("mac") 0) an...

by carset - Python文档中心 - 2009-04-25 08:17:46 阅读(1740) 回复(0)