Py学习  »  cumt_ttr  »  全部回复
回复总数  30
8 年前
回复了 cumt_ttr 创建的主题 » 只有wsgi,没有用任何服务器(apache, nginx等)如何实现https?

求救

9 年前
回复了 cumt_ttr 创建的主题 » XP下的phantomjs报:不是有效的win32应用程序

来个淫啊

9 年前
回复了 cumt_ttr 创建的主题 » django css apache 求教

同问

9 年前
回复了 cumt_ttr 创建的主题 » bootstrap3.0 中百度地图无法正常显示的问题,该怎么处理

搞定了,得把那个容器div设置好高度

原来 pythong 是个那啥啊,还以为作者敲错了,但还是出错了

[root@iZ28ujuc64uZ myblog]# pythong setup.py Would you like a bin directory? [Y/n] y Would you like a tests directory? [Y/n] y Creating structure for new Python project setup.py. Traceback (most recent call last): File "/usr/local/bin/pythong", line 9, in <module> load_entry_point('pythong==0.7.1', 'console_scripts', 'pythong')() File "/usr/local/lib/python2.7/site-packages/pythong/init.py", line 32, in parse_command prompt_new_project(args.name, args.snap) File "/usr/local/lib/python2.7/site-packages/pythong/project.py", line 69, in prompt_new_project raise e OSError: [Errno 20] Not a directory: '/root/myblog/setup.py/bin'

[root@......Z myblog]# python2.7 setup.py usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help

error: no commands supplied

9 年前
回复了 cumt_ttr 创建的主题 » 请问哪里有django1.7能用的富文本插件?

tinyMce?

9 年前
回复了 cumt_ttr 创建的主题 » 问个关于linux的PATH路径的问题

我搞定了,是因为hash的原因,hash -r 一下清除下缓存奏好了,谢谢各位的围观

谢谢楼上的,我再看看

就是裂开了

亲,你的第二版呢?

9 年前
回复了 cumt_ttr 创建的主题 » from package1.package2 import * 基本没用?

@Django中国社区 要是啥都不写,就毛用没有?

第二版呢,楼主?

9 年前
回复了 cumt_ttr 创建的主题 » 一个关于后台定制的问题

好的办法是: 给函数加个short_description

def was_published_recently(self):
        return self.cjsj >= timezone.now() - datetime.timedelta(days=1)
    was_published_recently.short_description = '最近发布'
9 年前
回复了 cumt_ttr 创建的主题 » Django后台DateTimeField字段如何控制输出格式?

找到解决办法了 http://stackoverflow.com/questions/7216764/in-the-django-admin-site-how-do-i-change-the-display-format-of-time-fields

9 年前
回复了 cumt_ttr 创建的主题 » 一个关于后台定制的问题

效果是达到了 enter image description here

9 年前
回复了 cumt_ttr 创建的主题 » 一个关于后台定制的问题

这样修改是不是有点可悲???有没有更优雅的办法?

enter image description here

9 年前
回复了 cumt_ttr 创建的主题 » Django学习笔记(6):Django站点管理

还是写的很浅啊

9 年前
回复了 cumt_ttr 创建的主题 » 官方文档的这部分是不是写的有问题?

搞清楚了,是related_name惹的,我在ForeignKey上添加了related_name

9 年前
回复了 cumt_ttr 创建的主题 » 官方文档的这部分是不是写的有问题?

报类似的错误 FieldError: Cannot resolve keyword 'article' into field. Choices are: 。。。。

9 年前
回复了 cumt_ttr 创建的主题 » django中有没有一种"include view"视图的方法?

extends标签?

9 年前
回复了 cumt_ttr 创建的主题 » python中使用代理怎么老是出错,这是为毛?
def sub_downloader():
    hash1 = r'ffd8d4aa68033dc03d1c8ef373b9028c'

    headers = {
        'User-Agent':
            'SubDB/1.0 (subtitle-downloader-mabing/1.0; http://github.com/manojmj92/subtitle-downloader-mabing)'}
    #u = "http://api.thesubdb.com/?action=download&hash=%s&language=en" % (urllib.quote(hash1))
    u = "http://api.thesubdb.com/?action=download&hash=ffd8d4aa68033dc03d1c8ef373b9028c&language=en"
    if pyVer == 3:
        proxies = {'http': 'http://24.143.198.188:80'}
        #filehandle = urllib.urlopen(some_url, proxies=proxies)
        #req = urllib.request.Request(url, None, headers)

    response = urllib.urlopen(u, proxies=proxies).read()
    #else:
    #url   = ‘http://www.vimer.cn/’
    #proxy = ‘xxx.xxxx.com:8080′
    #opener = urllib2.build_opener( urllib2.ProxyHandler({‘http’:proxy}) )
    #urllib2.install_opener( opener )
    #sContent = urllib2.urlopen(url)
    #proxy = '24.143.198.188:80'
    #opener = urllib2.build_opener(urllib2.ProxyHandler({'http': proxy}))
    #req = urllib2.Request("http://www.baidu.com", '', headers)
    #urllib2.install_opener(opener)
    #response = urllib2.urlopen(req).read()
    with open('j:/01' + ".srt", "wb") as subtitle:
        subtitle.write(response)

现在改成了这样,文件内容变成这样了 <HTML><HEAD> <TITLE>Invalid URL</TITLE> </HEAD><BODY> <H1>Invalid URL</H1>

The requested URL "&#47;&#63;action&#61;download&#38;hash&#61;ffd8d4aa68033dc03d1c8ef373b9028c&#38;language&#61;en", is invalid.<p>
Reference&#32;&#35;9&#46;bcc68f18&#46;1408796874&#46;22f563
</BODY></HTML>
9 年前
回复了 cumt_ttr 创建的主题 » python中使用代理怎么老是出错,这是为毛?

不用代理,这段代码是没问题的,请教这个跟我的本机的什么设置有关系么?

9 年前
回复了 cumt_ttr 创建的主题 » django写的Rss怎么不大对,帮我看看捏

@the5fire 看了半天也不知道我的问题在那里,不过还是谢谢

9 年前
回复了 cumt_ttr 创建的主题 » 问个Django book2.0里 包装视图函数 的问题

@Django中国社区 嗯,谢谢,当时脑袋抽了,怎么试也不行。。。。。

9 年前
回复了 cumt_ttr 创建的主题 » Python在import时路径搜索的疑问

我就搞不懂了,在这个目录下放一个sting.py,内容为 print 'string'*8 从这个目录进入cmd ,import string 后执行 同样放个sys,内容一样,就不行了。re也一样不行,why?

import string stringstringstringstringstringstringstringstring import re import sys

我查看了了 sys.modules.keys()

'string' in sys.modules.keys() False 're' in sys.modules.keys() True 'sys' in sys.modules.keys() True

原来有的模块已经被载入了啊

9 年前
回复了 cumt_ttr 创建的主题 » Python在import时路径搜索的疑问

@Django中国社区

sys.path ['', 'I:\djangoproject', 'C:\WINDOWS\system32\python27.zip', 'I:\Program Files\Python27\DLLs', 'I:\Program Files\Python27\lib', 'I:\Program Files\Python27\lib\plat-win', 'I:\Program Fil es\Python27\lib\lib-tk', 'I:\Program Files\Python27', 'I:\Program Files\Python27\lib\site-packages']

第一个空格就是当前目录啊

9 年前
回复了 cumt_ttr 创建的主题 » Django 1.7就要来了

支持Python 2.x 么?

9 年前
回复了 cumt_ttr 创建的主题 » 官方文档的一段英文翻译求解惑

@爱情的枪 加3引号? '''

9 年前
回复了 cumt_ttr 创建的主题 » 官方文档的一段英文翻译求解惑

是不是说引号用在Oracle数据库里面无效,用在Django这里能起阻止转为大写和被截断的作用?