2007年06月14日 星期四 09:50
¹âÕf²»¾ ²»ÊǺðÑʽ ÔÚ07-6-12£¬cun heise <cunheise在hotmail.com> дµÀ£º > > do it first, if you need something just add it. if you think that is > difficult why use django? > > > >From: "´óÀÉ" <iexper在gmail.com> > >Reply-To: python-chinese在lists.python.cn > >To: python-chinese在lists.python.cn > >Subject: Re: [python-chinese]ÎÒ´òËãŪһ¸ödjangoÖйúÍøÕ¾ > >Date: Tue, 12 Jun 2007 13:02:27 +0800 > > > >ºÃ°É£¬ÎÒÀ´¸ö×ܽᣬ"±ðÆÚÍûÌ«¸ß"¡£ > >¾ÍÁ¬×ÄľÄñÕâÑùµÄ×é֯ҲûÓиºÔðÆðÕâÑùµÄ¹¦Óá£Ä㻹ÆÚÍûɶ£¿ > > > >ÄÇôZoom.QuitÊÇ·ñ¿¼ÂÇÉÏÒÔÉϸ÷λÐǪ̈Ìáµ½µÄÊÂÇéÄØ£¿ > > > >On 6/12/07, yuan xuan <xuanyuan14.leo在gmail.com> wrote: > >> > >>±ãÓÚ½»Á÷µÄÂÛ̳ÊDz»¿ÉÉٵġ£ > >>»¹¿ÉÒÔ¿¼ÂÇÒ»¸öÏîÄ¿×é֯ƽ̨£¬²ÎÓëÕß×ÔÐÐ×¢²áеÄDjangoÏîÄ¿£¬Ìá³öÐèÇ󣬴ó¼Ò×Ô > ÓɲÎÓ뽨Éè¡£Õâ¶ÔÏîÄ¿×éÖ¯¹ÜÀí£¬ÊÇÒ»¸öÌôÕ½¡£ > >> > >>ÔÚ07-6-9£¬Airecho Python <airecho.python在gmail.com > дµÀ£º > >> > > >> > > >>ÈçÌâ,×î½üÔÚѧϰdjango,´òËãŪһ¸öÍêÈ«djangoÏà¹ØµÄ½»Á÷ƽ̨,ÔÚÕâÀïÏò´ó¼ÒÕ÷Çó > Òâ¼ûºÍ½¨Òé(¸üÆÚ´ýÓй滮µÄ½¨ÉèÐÔÏë·¨).µ±È»,ÓÐÎÞ±ØÒª¸ãÕâô¸öƽ̨²»ÔÚÌÖÂÛ·¶Î§Ö® > ÁÐ. > >> > > >> > _______________________________________________ > >> > python-chinese > >> > Post: send python-chinese在lists.python.cn > >> > Subscribe: send subscribe to > >>python-chinese-request在lists.python.cn > >> > Unsubscribe: send unsubscribe to > >> > python-chinese-request在lists.python.cn > >> > Detail Info: http://python.cn/mailman/listinfo/python-chinese > >> > > >> > >> > >>_______________________________________________ > >>python-chinese > >>Post: send python-chinese在lists.python.cn > >>Subscribe: send subscribe to python-chinese-request在lists.python.cn > >>Unsubscribe: send unsubscribe to > >>python-chinese-request在lists.python.cn > >>Detail Info: http://python.cn/mailman/listinfo/python-chinese > >> > > > > > > > >-- > >ÎÒ×ßµ½Ò»¸öÄ°ÉúµÄµØ·½, ¸æËß±ðÈË ÎÒҪȥÁ÷ÀË > >Ŷ£¬ÎÒҪȥÁÆÉË¡¡ > > > >Gtalk: iexper(at)gmail.com > >ÓòÃû¹ýÆÚÁË > > > >_______________________________________________ > >python-chinese > >Post: send python-chinese在lists.python.cn > >Subscribe: send subscribe to python-chinese-request在lists.python.cn > >Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > >Detail Info: http://python.cn/mailman/listinfo/python-chinese > > _________________________________________________________________ > ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¨D MSN Hotmail¡£ http://www.hotmail.com > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070614/e2772774/attachment.html
2007年06月14日 星期四 11:01
Ç¿ÁÒÖ§³Ö£¬²»¹ý°´ÕÕÒÔÍùdjangoÏà¹ØÖÐÎĽ»Á÷ÍøÕ¾À´¿´£¬×ÜÓÐЩÇú¸ßºÍ¹ÑµÄ¸Ð¾õ¡¡¶øÇÒÎÒÈÏΪ£¬×ÄľÄñºÍÓʼþÁбíÕâ·½Ãæ×÷ÓõÄDZÁ¦»¹ÓУ¬½¨ÒéÑ¡ÌâÔÙÕå×à ÔÚ07-6-9£¬Airecho Python <airecho.python在gmail.com> дµÀ£º > > ÈçÌâ,×î½üÔÚѧϰdjango,´òËãŪһ¸öÍêÈ«djangoÏà¹ØµÄ½»Á÷ƽ̨,ÔÚÕâÀïÏò´ó¼ÒÕ÷ÇóÒâ¼ûºÍ½¨Òé(¸üÆÚ´ýÓй滮µÄ½¨ÉèÐÔÏë·¨).µ±È»,ÓÐÎÞ±ØÒª¸ãÕâô¸öƽ̨²»ÔÚÌÖÂÛ·¶Î§Ö®ÁÐ. > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070614/cbd2e735/attachment-0001.html
2007年06月15日 星期五 10:30
ÔÚ07-6-14£¬klutz chump <chumpklutz at gmail.com> дµÀ£º > > ¹âÕf²»¾ ²»ÊǺðÑʽ ¿¼ÂÇÖ®ÖУ¬×ܵÃÕչ˴ó¶àÊýÈ˵ÄÏë·¨£¬·ñÔòÎÒÒ»ÏáÇéԸûÈË·ÃÎÊ»áºÜÆà²ÒµÄ¡£ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070615/e573fccd/attachment.html
2007年06月15日 星期五 17:43
Çë½Ì:ÓÐÄÄλŪ¹ýÔÚdjangoÖÐÔö¼ÓFckeditorÉÏ´«¹¦ÄܵÄ(ÊÇÖ¸FckEditor×Ô´øµÄÎļþÉÏ´«)? ¸ãÁË°ëÌìÅä²»ÆðÀ´Ñ½! -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070615/e3b30134/attachment.html
2007年06月15日 星期五 17:54
我做过,写的不是很好,目前能对付着用,关键代码如下,其他的部分你自己补全(我还没考虑到重用性那一步): ========= view 代码 imagebrowser.py ===============: #!/usr/bin/env python #coding=utf-8 # FCKEditor 上传文件 # by Neil Chen from myproject.forum.models import * from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext import os, datetime, random from utils import image def get_random_filename(): """得到随机的头像文件名称""" now = datetime.datetime.now() fname = "img_" + now.strftime("%y%m%d%H%M%S") + "_" + \ str(random.randint(0,99999)).rjust(5,'0') # 暂不作文件重名检验 return fname def index(request): error_msg = "" if request.method == 'POST': # 保存上传的图片 file_obj = request.FILES.get('image1', None) if file_obj: path, ext = os.path.splitext(file_obj['filename']) if ext.lower() not in [".jpg", ".jpeg", ".bmp", ".png", ".gif"]: error_msg = _("The image file must have one of the following extensions: %(exts)s") % {"exts": ".jpg, .jpeg, .bmp, .png, .gif"} else: # 保存文件内容 fname = get_random_filename() uploadimage = UploadImage(user=request.user) uploadimage.save_image_file(fname + ext, file_obj['content']) filename = uploadimage.get_image_filename() # 生成缩略图 image.make_upload_image_thumb(filename) files = request.user.upload_images.all() for f in files: f.filename = os.path.basename(f.get_image_filename()) return render_to_response("fckeditor/imagebrowser.html", { 'files': files, 'error_msg': error_msg, }, context_instance=RequestContext(request)) ========= 模板代码: imagebrowser.html =============: {% load i18n %}在 07-6-15,benyu<bbenyu在gmail.com> 写道: > > > 请教:有哪位弄过在django中增加Fckeditor上传功能的(是指FckEditor自带的文件上传)? > > 搞了半天配不起来呀! > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese >My File Browser {% if files %} {% for file in files %}{% endfor %} {% else %} {% trans 'There are no images in the gallery currently.' %} {% endif %}{{ file.filename }}
2007年06月15日 星期五 17:56
另外需要 fckeditor.js 里面做一点简单的配置,参考下 fckeditor 的文档即可。 FCKConfig.ImageBrowserURL = "/fckeditor/imagebrowser/" 在 Django 里建一个 fckEditor 的 app, 处理上述地址,指向上面我帖的那个 view.
2007年06月15日 星期五 18:15
http://code.google.com/p/django-fckconnector 可用!我在用! On 6/15/07, benyu <bbenyu at gmail.com> wrote: > > 请教:有哪位弄过在django中增加Fckeditor上传功能的(是指FckEditor自带的文件上传)? > > 搞了半天配不起来呀! > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- http://codeplayer.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070615/2630cc95/attachment.htm
2007年06月15日 星期五 18:21
不错,我还不知道有这个。有空也学习一下。 在 07-6-15,黄毅<yi.codeplayer在gmail.com> 写道: > http://code.google.com/p/django-fckconnector > 可用!我在用! >
2007年06月17日 星期日 18:28
Ôõôû¿´¼ûʲô˵Ã÷ÐÔµÄÎĵµÑ½? ÒªÔõôÕûѽ?ÊÇÐèÒªÐÞ¸Äfckconfig.jsÎĵµ,ÅäºÏʹÓÃÂð? ¸ü¸ÄFCKConfig.FlashBrowserURL Ö®ÀàµÄ²ÎÊý? benyu 2007-06-17 ·¢¼þÈË£º »ÆÒã ·¢ËÍʱ¼ä£º 2007-06-15 18:16:29 ÊÕ¼þÈË£º python-chinese在lists.python.cn ³ËÍ£º Ö÷Ì⣺ Re: [python-chinese]Çë½Ì:ÓÐÄÄλŪ¹ýÔÚdjangoÖÐÔö¼ÓFckeditorÉÏ´«¹¦ÄܵÄ? http://code.google.com/p/django-fckconnector ¿ÉÓã¡ÎÒÔÚÓã¡ On 6/15/07, benyu <bbenyu在gmail.com> wrote: Çë½Ì:ÓÐÄÄλŪ¹ýÔÚdjangoÖÐÔö¼ÓFckeditorÉÏ´«¹¦ÄܵÄ(ÊÇÖ¸FckEditor×Ô´øµÄÎļþÉÏ´«)? ¸ãÁË°ëÌìÅä²»ÆðÀ´Ñ½! _______________________________________________ python-chinese Post: send python-chinese在lists.python.cn Subscribe: send subscribe to python-chinese-request在lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -- http://codeplayer.blogspot.com/ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070617/d4416118/attachment.html
2007年06月17日 星期日 22:31
Ìù¶ÎÎҵĴúÂ룬ӦÓÃÔÚwww.mriabc.netµÄÂÛ̳ÉÏÁË def uploader(request): outdir = '/var/www/mriabc/medias/userupload/' new_file = request.FILES.get('NewFile', None) if new_file: try: im = Image.open(StringIO.StringIO(new_file["content"])) output = request.user.username+'_'+datetime.now ().strftime('%Y-%m-%d-%H-%M-%S')+'.jpg' url = Image.open(outdir+'url.gif') im.paste(url, (0,0,120,20)) im.save('%s%s' % (outdir, output)) fileurl = '/medias/userupload/'+output filename = new_file['filename'] status = 0 custommessage = '' except: status = 202 fileurl = '' filename = '' custommessage = '' else: status = 202 fileurl = '' filename = '' custommessage = '' return HttpResponse( """ """ %( status, fileurl, filename, custommessage ) ) ×¢Òâreturn£¬¾ßÌå¿ÉÒԲ鿴ÏÂfckµÄapiÈç¹û´ó¼ÒÓиüºÃµÄ±ðÍüÁË·ÖÏíÎÒÒ»·Ýѧϰѧϰѽ¡£ ÎÒÕâÀï¶ÔÉÏ´«µÄͼƬ×Ô¶¯¼ÓÁ˸öÍøÕ¾µÄµØÖ· -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070617/c677a059/attachment.html
2007年06月18日 星期一 01:06
代码里面有个 REAME 很详细的文档。 On 6/17/07, benyu <bbenyu at gmail.com> wrote: > > 怎么没看见什么说明性的文档呀? > 要怎么整呀?是需要修改fckconfig.js文档,配合使用吗? > 更改FCKConfig.FlashBrowserURL 之类的参数? > > ------------------------------ > benyu > 2007-06-17 > ------------------------------ > *发件人:* 黄毅 > *发送时间:* 2007-06-15 18:16:29 > *收件人:* python-chinese at lists.python.cn > *抄送:* > *主题:* Re: [python-chinese]请教:有哪位弄过在django中增加Fckeditor上传功能的? > > http://code.google.com/p/django-fckconnector > 可用!我在用! > > > On 6/15/07, benyu <bbenyu at gmail.com> wrote: > > > > 请教:有哪位弄过在django中增加Fckeditor上传功能的(是指FckEditor自带的文件上传)? > > > > 搞了半天配不起来呀! > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > http://codeplayer.blogspot.com/ > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- http://codeplayer.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070618/17c869ce/attachment.html
Zeuux © 2025
京ICP备05028076号